x86: Reduce page->shadow_flags to 32 bits so we can steal space for a
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Jun 2008 16:57:03 +0000 (17:57 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Jun 2008 16:57:03 +0000 (17:57 +0100)
spinlock_t (on 64-bit Xen) without expanding the page_info struct.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/mm/shadow/common.c
xen/include/asm-x86/mm.h

index aa3bc47d74565f80f19814810ca1d10fa753d475..4cfcc5fb58a72e141e84a97ed373ebd4ecaa7d88 100644 (file)
@@ -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);
     }
index 43ec82cf2c89c9634df55985a4cce530d2cfabb4..3a5a64e9227bf71adfd131446ce86f4c2249beb9 100644 (file)
@@ -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)