aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-05 23:47:09 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-05 23:47:09 +0100
commitec7c322ccd8def4302df3862c9b4eb4afbdb19e2 (patch)
treec96e8370229cbb8dca381a04ece1d5e8dc3073d2
parentc436ce043df0eec436d8019a404a2ef51ac1ec93 (diff)
downloadxen-ec7c322ccd8def4302df3862c9b4eb4afbdb19e2.tar.gz
xen-ec7c322ccd8def4302df3862c9b4eb4afbdb19e2.tar.bz2
xen-ec7c322ccd8def4302df3862c9b4eb4afbdb19e2.zip
Reformat the pfn_info structure to ensure that
lock cmpxchg8b instructions occur only on naturally aligned 8-byte memory values. This is needed for some NUMA x86 systems. Signed-off-by: Keir Fraser <keir@xensource.com> Signed-off-by: Aravindh Puthiyaparambil <first.last@unisys.com>
-rw-r--r--xen/arch/x86/x86_32/mm.c1
-rw-r--r--xen/arch/x86/x86_64/mm.c6
-rw-r--r--xen/include/asm-x86/mm.h14
3 files changed, 12 insertions, 9 deletions
diff --git a/xen/arch/x86/x86_32/mm.c b/xen/arch/x86/x86_32/mm.c
index 25c2ea7a7d..64491f02d9 100644
--- a/xen/arch/x86/x86_32/mm.c
+++ b/xen/arch/x86/x86_32/mm.c
@@ -156,6 +156,7 @@ void subarch_init_memory(struct domain *dom_xen)
*/
if ( (offsetof(struct pfn_info, u.inuse._domain) !=
(offsetof(struct pfn_info, count_info) + sizeof(u32))) ||
+ ((offsetof(struct pfn_info, count_info) & 7) != 0) ||
(sizeof(struct pfn_info) != 24) )
{
printk("Weird pfn_info layout (%ld,%ld,%d)\n",
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 76b3518111..a20c900fb0 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -137,8 +137,10 @@ void subarch_init_memory(struct domain *dom_xen)
* count_info and domain fields must be adjacent, as we perform atomic
* 64-bit operations on them.
*/
- if ( (offsetof(struct pfn_info, u.inuse._domain) !=
- (offsetof(struct pfn_info, count_info) + sizeof(u32))) )
+ if ( ((offsetof(struct pfn_info, u.inuse._domain) !=
+ (offsetof(struct pfn_info, count_info) + sizeof(u32)))) ||
+ ((offsetof(struct pfn_info, count_info) & 7) != 0) ||
+ (sizeof(struct pfn_info) != 40) )
{
printk("Weird pfn_info layout (%ld,%ld,%ld)\n",
offsetof(struct pfn_info, count_info),
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index a68538c0a7..9b79f86d6f 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -22,9 +22,6 @@ struct pfn_info
/* Each frame can be threaded onto a doubly-linked list. */
struct list_head list;
- /* Timestamp from 'TLB clock', used to reduce need for safety flushes. */
- u32 tlbflush_timestamp;
-
/* Reference count and various PGC_xxx flags and fields. */
u32 count_info;
@@ -37,17 +34,20 @@ struct pfn_info
u32 _domain; /* pickled format */
/* Type reference count and various PGT_xxx flags and fields. */
unsigned long type_info;
- } inuse;
+ } __attribute__ ((packed)) inuse;
/* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
struct {
+ /* Order-size of the free chunk this page is the head of. */
+ u32 order;
/* Mask of possibly-tainted TLBs. */
cpumask_t cpumask;
- /* Order-size of the free chunk this page is the head of. */
- u8 order;
- } free;
+ } __attribute__ ((packed)) free;
} u;
+
+ /* Timestamp from 'TLB clock', used to reduce need for safety flushes. */
+ u32 tlbflush_timestamp;
};
/* The following page types are MUTUALLY EXCLUSIVE. */