From: Keir Fraser Date: Thu, 12 Jun 2008 16:57:03 +0000 (+0100) Subject: x86: Reduce page->shadow_flags to 32 bits so we can steal space for a X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14192^2~80 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=731718e4f88d8d57865b9e3054271ea67d369a60;p=xen.git x86: Reduce page->shadow_flags to 32 bits so we can steal space for a spinlock_t (on 64-bit Xen) without expanding the page_info struct. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index aa3bc47d74..4cfcc5fb58 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -463,11 +463,7 @@ void shadow_demote(struct vcpu *v, mfn_t gmfn, u32 type) clear_bit(type, &page->shadow_flags); if ( (page->shadow_flags & SHF_page_type_mask) == 0 ) - { - /* tlbflush timestamp field is valid again */ - page->tlbflush_timestamp = tlbflush_current_time(); clear_bit(_PGC_page_table, &page->count_info); - } } /**************************************************************************/ @@ -2076,7 +2072,7 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int fast, int all) if ( !fast && all && (pg->count_info & PGC_page_table) ) { SHADOW_ERROR("can't find all shadows of mfn %05lx " - "(shadow_flags=%08lx)\n", + "(shadow_flags=%08x)\n", mfn_x(gmfn), pg->shadow_flags); domain_crash(v->domain); } diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 43ec82cf2c..3a5a64e922 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -59,8 +59,12 @@ struct page_info * tlbflush_timestamp since page table pages are explicitly not * tracked for TLB-flush avoidance when a guest runs in shadow mode. */ - unsigned long shadow_flags; + u32 shadow_flags; }; + +#if defined(__x86_64__) + spinlock_t lock; +#endif }; /* The following page types are MUTUALLY EXCLUSIVE. */ @@ -89,9 +93,11 @@ struct page_info /* Cleared when the owning guest 'frees' this page. */ #define _PGC_allocated 31 #define PGC_allocated (1U<<_PGC_allocated) - /* Set on a *guest* page to mark it out-of-sync with its shadow */ -#define _PGC_out_of_sync 30 -#define PGC_out_of_sync (1U<<_PGC_out_of_sync) +#if defined(__i386__) + /* Page is locked? */ +# define _PGC_locked 30 +# define PGC_locked (1U<<_PGC_out_of_sync) +#endif /* Set when is using a page as a page table */ #define _PGC_page_table 29 #define PGC_page_table (1U<<_PGC_page_table)