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

[Xen-changelog] [xen-unstable] [XEN] Make the compat-mode l4 page table look more like a page table



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1172668647 0
# Node ID 5943a8314d699de56ee89bd67c0ecf615e0e4db6
# Parent  9edd8d7c9355c4c7af358322daf68720042f0ec7
[XEN] Make the compat-mode l4 page table look more like a page table
and remove some special-case code in the shadows.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/domain.c           |    4 ++++
 xen/arch/x86/mm/shadow/common.c |    7 ++-----
 xen/arch/x86/mm/shadow/multi.c  |    9 ++-------
 3 files changed, 8 insertions(+), 12 deletions(-)

diff -r 9edd8d7c9355 -r 5943a8314d69 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Feb 28 10:40:52 2007 +0000
+++ b/xen/arch/x86/domain.c     Wed Feb 28 13:17:27 2007 +0000
@@ -229,6 +229,10 @@ static int setup_compat_l4(struct vcpu *
 
     if ( !pg )
         return -ENOMEM;
+
+    /* This page needs to look like a pagetable so that it can be shadowed */
+    pg->u.inuse.type_info = PGT_l4_page_table|PGT_validated;
+
     l4tab = copy_page(page_to_virt(pg), idle_pg_table);
     l4tab[l4_table_offset(LINEAR_PT_VIRT_START)] =
         l4e_from_page(pg, __PAGE_HYPERVISOR);
diff -r 9edd8d7c9355 -r 5943a8314d69 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Wed Feb 28 10:40:52 2007 +0000
+++ b/xen/arch/x86/mm/shadow/common.c   Wed Feb 28 13:17:27 2007 +0000
@@ -489,11 +489,7 @@ void shadow_demote(struct vcpu *v, mfn_t
 {
     struct page_info *page = mfn_to_page(gmfn);
 
-#ifdef CONFIG_COMPAT
-    if ( !IS_COMPAT(v->domain) || type != SH_type_l4_64_shadow )
-#endif
-        ASSERT(test_bit(_PGC_page_table, &page->count_info));
-
+    ASSERT(test_bit(_PGC_page_table, &page->count_info));
     ASSERT(test_bit(type, &page->shadow_flags));
 
     clear_bit(type, &page->shadow_flags);
@@ -1625,6 +1621,7 @@ void sh_destroy_shadow(struct vcpu *v, m
         break;
     case SH_type_l2h_64_shadow:
         ASSERT( IS_COMPAT(v->domain) );
+        /* Fall through... */
     case SH_type_l2_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 4, 4)(v, smfn);
         break;
diff -r 9edd8d7c9355 -r 5943a8314d69 xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c    Wed Feb 28 10:40:52 2007 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c    Wed Feb 28 13:17:27 2007 +0000
@@ -3368,16 +3368,11 @@ sh_set_toplevel_shadow(struct vcpu *v,
     
 #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
     /* Once again OK to unhook entries from this table if we see fork/exit */
-#if CONFIG_PAGING_LEVELS == 4
-    if ( IS_COMPAT(d) )
-        ASSERT(!sh_mfn_is_a_page_table(gmfn));
-    else
-#endif
-        ASSERT(sh_mfn_is_a_page_table(gmfn));
+    ASSERT(sh_mfn_is_a_page_table(gmfn));
     mfn_to_page(gmfn)->shadow_flags &= ~SHF_unhooked_mappings;
 #endif
 
-    /* Pin the shadow and put it (back) on the list of top-level shadows */
+    /* Pin the shadow and put it (back) on the list of pinned shadows */
     if ( sh_pin(v, smfn) == 0 )
     {
         SHADOW_ERROR("can't pin %#lx as toplevel shadow\n", mfn_x(smfn));

_______________________________________________
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®.