ia64/xen-unstable

changeset 7235:bde548fff7b4

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>
author kaf24@firebug.cl.cam.ac.uk
date Wed Oct 05 23:47:09 2005 +0100 (2005-10-05)
parents 21606b84b730
children c344d6944d2f
files xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_64/mm.c xen/include/asm-x86/mm.h
line diff
     1.1 --- a/xen/arch/x86/x86_32/mm.c	Wed Oct 05 23:15:00 2005 +0100
     1.2 +++ b/xen/arch/x86/x86_32/mm.c	Wed Oct 05 23:47:09 2005 +0100
     1.3 @@ -156,6 +156,7 @@ void subarch_init_memory(struct domain *
     1.4       */
     1.5      if ( (offsetof(struct pfn_info, u.inuse._domain) != 
     1.6            (offsetof(struct pfn_info, count_info) + sizeof(u32))) ||
     1.7 +         ((offsetof(struct pfn_info, count_info) & 7) != 0) ||
     1.8           (sizeof(struct pfn_info) != 24) )
     1.9      {
    1.10          printk("Weird pfn_info layout (%ld,%ld,%d)\n",
     2.1 --- a/xen/arch/x86/x86_64/mm.c	Wed Oct 05 23:15:00 2005 +0100
     2.2 +++ b/xen/arch/x86/x86_64/mm.c	Wed Oct 05 23:47:09 2005 +0100
     2.3 @@ -137,8 +137,10 @@ void subarch_init_memory(struct domain *
     2.4       * count_info and domain fields must be adjacent, as we perform atomic
     2.5       * 64-bit operations on them.
     2.6       */
     2.7 -    if ( (offsetof(struct pfn_info, u.inuse._domain) != 
     2.8 -          (offsetof(struct pfn_info, count_info) + sizeof(u32))) )
     2.9 +    if ( ((offsetof(struct pfn_info, u.inuse._domain) != 
    2.10 +           (offsetof(struct pfn_info, count_info) + sizeof(u32)))) ||
    2.11 +         ((offsetof(struct pfn_info, count_info) & 7) != 0) ||
    2.12 +         (sizeof(struct pfn_info) != 40) )
    2.13      {
    2.14          printk("Weird pfn_info layout (%ld,%ld,%ld)\n",
    2.15                 offsetof(struct pfn_info, count_info),
     3.1 --- a/xen/include/asm-x86/mm.h	Wed Oct 05 23:15:00 2005 +0100
     3.2 +++ b/xen/include/asm-x86/mm.h	Wed Oct 05 23:47:09 2005 +0100
     3.3 @@ -22,9 +22,6 @@ struct pfn_info
     3.4      /* Each frame can be threaded onto a doubly-linked list. */
     3.5      struct list_head list;
     3.6  
     3.7 -    /* Timestamp from 'TLB clock', used to reduce need for safety flushes. */
     3.8 -    u32 tlbflush_timestamp;
     3.9 -
    3.10      /* Reference count and various PGC_xxx flags and fields. */
    3.11      u32 count_info;
    3.12  
    3.13 @@ -37,17 +34,20 @@ struct pfn_info
    3.14              u32 _domain; /* pickled format */
    3.15              /* Type reference count and various PGT_xxx flags and fields. */
    3.16              unsigned long type_info;
    3.17 -        } inuse;
    3.18 +        } __attribute__ ((packed)) inuse;
    3.19  
    3.20          /* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
    3.21          struct {
    3.22 +            /* Order-size of the free chunk this page is the head of. */
    3.23 +            u32 order;
    3.24              /* Mask of possibly-tainted TLBs. */
    3.25              cpumask_t cpumask;
    3.26 -            /* Order-size of the free chunk this page is the head of. */
    3.27 -            u8 order;
    3.28 -        } free;
    3.29 +        } __attribute__ ((packed)) free;
    3.30  
    3.31      } u;
    3.32 +
    3.33 +    /* Timestamp from 'TLB clock', used to reduce need for safety flushes. */
    3.34 +    u32 tlbflush_timestamp;
    3.35  };
    3.36  
    3.37   /* The following page types are MUTUALLY EXCLUSIVE. */