References: bnc#470949 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -1902,7 +1902,7 @@ static void sh_hash_audit_bucket(struct { if ( !page_is_out_of_sync(gpg) ) { - SHADOW_ERROR("MFN %#lx shadowed (by %#"PRI_mfn")" + SHADOW_ERROR("MFN %#x shadowed (by %#"PRI_mfn")" " and not OOS but has typecount %#lx\n", sp->backpointer, mfn_x(shadow_page_to_mfn(sp)), @@ -1916,7 +1916,7 @@ static void sh_hash_audit_bucket(struct if ( (gpg->u.inuse.type_info & PGT_type_mask) == PGT_writable_page && (gpg->u.inuse.type_info & PGT_count_mask) != 0 ) { - SHADOW_ERROR("MFN %#lx shadowed (by %#"PRI_mfn")" + SHADOW_ERROR("MFN %#x shadowed (by %#"PRI_mfn")" " but has typecount %#lx\n", sp->backpointer, mfn_x(shadow_page_to_mfn(sp)), gpg->u.inuse.type_info); --- a/xen/arch/x86/mm/shadow/private.h +++ b/xen/arch/x86/mm/shadow/private.h @@ -190,7 +190,7 @@ struct shadow_page_info struct { union { /* When in use, guest page we're a shadow of */ - unsigned long backpointer; + unsigned int backpointer; /* When free, order of the freelist we're on */ unsigned int order; }; @@ -204,12 +204,17 @@ struct shadow_page_info /* When free, TLB flush time when freed */ u32 tlbflush_timestamp; }; +#ifdef __i386__ + unsigned long mbz; /* Must be zero: count_info is here. */ +#endif struct { - unsigned long mbz; /* Must be zero: count_info is here. */ unsigned long type:5; /* What kind of shadow is this? */ unsigned long pinned:1; /* Is the shadow pinned? */ unsigned long count:26; /* Reference count */ }; +#ifndef __i386__ + unsigned long mbz; /* Must be zero: count_info is here. */ +#endif union { /* For unused shadow pages, a list of pages of this order; for * pinnable shadows, if pinned, a list of other pinned shadows @@ -645,7 +650,7 @@ static inline int sh_get_ref(struct vcpu if ( unlikely(nx >= 1U<<26) ) { - SHADOW_PRINTK("shadow ref overflow, gmfn=%" PRtype_info " smfn=%lx\n", + SHADOW_PRINTK("shadow ref overflow, gmfn=%x smfn=%lx\n", sp->backpointer, mfn_x(smfn)); return 0; } --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -15,7 +15,7 @@ * 1. 'struct page_info' contains a 'struct list_head list'. * 2. Provide a PFN_ORDER() macro for accessing the order of a free page. */ -#define PFN_ORDER(_pfn) ((_pfn)->u.free.order) +#define PFN_ORDER(_pfn) ((_pfn)->v.free.order) struct page_info { @@ -30,16 +30,12 @@ struct page_info /* Page is in use: ((count_info & PGC_count_mask) != 0). */ struct { - /* Owner of this page (NULL if page is anonymous). */ - u32 _domain; /* pickled format */ /* Type reference count and various PGT_xxx flags and fields. */ unsigned long type_info; } 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; } free; @@ -47,6 +43,22 @@ struct page_info } u; union { + + /* Page is in use. */ + struct { + /* Owner of this page (NULL if page is anonymous). */ + u32 _domain; /* pickled format */ + } inuse; + + /* Page is on a free list. */ + struct { + /* Order-size of the free chunk this page is the head of. */ + u32 order; + } free; + + } v; + + union { /* * Timestamp from 'TLB clock', used to avoid extra safety flushes. * Only valid for: a) free pages, and b) pages with zero type count @@ -173,8 +185,8 @@ static inline u32 pickle_domptr(struct d /* OOS fixup entries */ #define SHADOW_OOS_FIXUPS 2 -#define page_get_owner(_p) (unpickle_domptr((_p)->u.inuse._domain)) -#define page_set_owner(_p,_d) ((_p)->u.inuse._domain = pickle_domptr(_d)) +#define page_get_owner(_p) (unpickle_domptr((_p)->v.inuse._domain)) +#define page_set_owner(_p,_d) ((_p)->v.inuse._domain = pickle_domptr(_d)) #define maddr_get_owner(ma) (page_get_owner(maddr_to_page((ma)))) #define vaddr_get_owner(va) (page_get_owner(virt_to_page((va))))