[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: Reduce page->shadow_flags to 32 bits so we can steal space for a



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1213289823 -3600
# Node ID 98ed32885ec029f7d5dd1646b1469e6c15296421
# Parent  8182f5158dc25a670e3b6695af245c3f6331e38a
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 <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |    6 +-----
 xen/include/asm-x86/mm.h        |   14 ++++++++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff -r 8182f5158dc2 -r 98ed32885ec0 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Thu Jun 12 17:17:44 2008 +0100
+++ b/xen/arch/x86/mm/shadow/common.c   Thu Jun 12 17:57:03 2008 +0100
@@ -463,11 +463,7 @@ void shadow_demote(struct vcpu *v, mfn_t
     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, m
     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 -r 8182f5158dc2 -r 98ed32885ec0 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h  Thu Jun 12 17:17:44 2008 +0100
+++ b/xen/include/asm-x86/mm.h  Thu Jun 12 17:57:03 2008 +0100
@@ -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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.