[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86, shadow: shadow_page_info must be same size as page_info.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224594911 -3600
# Node ID f7c09997cf1133af257d3400ad31d26fc0aeab58
# Parent  e7f876c949552e5a6e31605114e3644040a73e14
x86, shadow: shadow_page_info must be same size as page_info.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/private.h |   63 ++++++++++++++++++++++-----------------
 1 files changed, 36 insertions(+), 27 deletions(-)

diff -r e7f876c94955 -r f7c09997cf11 xen/arch/x86/mm/shadow/private.h
--- a/xen/arch/x86/mm/shadow/private.h  Tue Oct 21 14:14:37 2008 +0100
+++ b/xen/arch/x86/mm/shadow/private.h  Tue Oct 21 14:15:11 2008 +0100
@@ -227,32 +227,40 @@ struct shadow_page_info
 struct shadow_page_info
 {
     union {
-        /* When in use, guest page we're a shadow of */
-        unsigned long backpointer;
-        /* When free, order of the freelist we're on */
-        unsigned int order;
-    };
-    union {
-        /* When in use, next shadow in this hash chain */
-        struct shadow_page_info *next_shadow;
-        /* When free, TLB flush time when freed */
-        u32 tlbflush_timestamp;
-    };
-    struct {
-        unsigned int type:5;      /* What kind of shadow is this? */
-        unsigned int pinned:1;    /* Is the shadow pinned? */
-        unsigned int count:26;    /* Reference count */
-        u32 mbz;                  /* Must be zero: this is where the owner 
-                                   * field lives in a non-shadow page */
-    } __attribute__((packed));
-    union {
-        /* For unused shadow pages, a list of pages of this order; 
-         * for pinnable shadows, if pinned, a list of other pinned shadows
-         * (see sh_type_is_pinnable() below for the definition of 
-         * "pinnable" shadow types). */
-        struct list_head list;
-        /* For non-pinnable shadows, a higher entry that points at us */
-        paddr_t up;
+        /* Ensures that shadow_page_info is same size as page_info. */
+        struct page_info page_info;
+
+        struct {
+            union {
+                /* When in use, guest page we're a shadow of */
+                unsigned long backpointer;
+                /* When free, order of the freelist we're on */
+                unsigned int order;
+            };
+            union {
+                /* When in use, next shadow in this hash chain */
+                struct shadow_page_info *next_shadow;
+                /* When free, TLB flush time when freed */
+                u32 tlbflush_timestamp;
+            };
+            struct {
+                unsigned int type:5;   /* What kind of shadow is this? */
+                unsigned int pinned:1; /* Is the shadow pinned? */
+                unsigned int count:26; /* Reference count */
+                u32 mbz;               /* Must be zero: this is where the
+                                        * owner field lives in page_info */
+            } __attribute__((packed));
+            union {
+                /* For unused shadow pages, a list of pages of this order; for 
+                 * pinnable shadows, if pinned, a list of other pinned shadows
+                 * (see sh_type_is_pinnable() below for the definition of 
+                 * "pinnable" shadow types). */
+                struct list_head list;
+                /* For non-pinnable shadows, a higher entry that points
+                 * at us. */
+                paddr_t up;
+            };
+        };
     };
 };
 
@@ -261,7 +269,8 @@ struct shadow_page_info
  * Also, the mbz field must line up with the owner field of normal 
  * pages, so they look properly like anonymous/xen pages. */
 static inline void shadow_check_page_struct_offsets(void) {
-    BUILD_BUG_ON(sizeof (struct shadow_page_info) > sizeof (struct page_info));
+    BUILD_BUG_ON(sizeof (struct shadow_page_info) !=
+                 sizeof (struct page_info));
     BUILD_BUG_ON(offsetof(struct shadow_page_info, mbz) !=
                  offsetof(struct page_info, u.inuse._domain));
 };

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.