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

[Xen-changelog] Fix up the new non-paging direct_map shadow pagetable mode



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ad0c3fa46c7631c1c6b92f5277942755e190fda8
# Parent  0e7bdd973e17fc36bc3accfb48048665fdab4434
Fix up the new non-paging direct_map shadow pagetable mode
for SVM. Rename a vmx_ function in HVM-generic code to
hvm_.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 0e7bdd973e17 -r ad0c3fa46c76 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Feb  3 11:02:30 2006
+++ b/xen/arch/x86/hvm/hvm.c    Fri Feb  3 11:47:38 2006
@@ -53,7 +53,7 @@
 
 struct hvm_function_table hvm_funcs;
 
-static void vmx_zap_mmio_range(
+static void hvm_zap_mmio_range(
     struct domain *d, unsigned long pfn, unsigned long nr_pfn)
 {
     unsigned long i, val = INVALID_MFN;
@@ -95,12 +95,10 @@
 
     for ( i = 0; i < e820_map_nr; i++ )
     {
-        if (e820entry[i].type == E820_SHARED_PAGE)
-        {
+        if ( e820entry[i].type == E820_SHARED_PAGE )
             gpfn = (e820entry[i].addr >> PAGE_SHIFT);
-        }
         if ( e820entry[i].type == E820_IO )
-            vmx_zap_mmio_range(
+            hvm_zap_mmio_range(
                 d, 
                 e820entry[i].addr >> PAGE_SHIFT,
                 e820entry[i].size >> PAGE_SHIFT);
diff -r 0e7bdd973e17 -r ad0c3fa46c76 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri Feb  3 11:02:30 2006
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri Feb  3 11:47:38 2006
@@ -833,8 +833,11 @@
             va, eip, (unsigned long)regs->error_code);
 //#endif
 
-    if (!svm_paging_enabled(v)) 
-    {
+    if ( !svm_paging_enabled(v) )
+    {
+        if ( shadow_direct_map_fault(va, regs) ) 
+            return 1;
+
         handle_mmio(va, va);
         TRACE_VMEXIT(2,2);
         return 1;
@@ -1437,6 +1440,9 @@
             if (old_base_mfn)
                 put_page(mfn_to_page(old_base_mfn));
        }
+#endif
+#if CONFIG_PAGING_LEVELS == 2
+        shadow_direct_map_clean(v);
 #endif
         /* Now arch.guest_table points to machine physical. */
         v->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
@@ -2272,10 +2278,8 @@
 
     gpa = gva_to_gpa( gva );
     printk( "gva = %lx, gpa=%lx, gCR3=%x\n", gva, gpa, (u32)vmcb->cr3 );
-    if( !svm_paging_enabled(v) || mmio_space( gpa ) )
-    {
+    if( !svm_paging_enabled(v) || mmio_space(gpa) )
        return;
-    }
 
     /* let's dump the guest and shadow page info */
 
diff -r 0e7bdd973e17 -r ad0c3fa46c76 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Fri Feb  3 11:02:30 2006
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Fri Feb  3 11:47:38 2006
@@ -417,9 +417,8 @@
     /* current core is the one we will perform the vmrun on */
     v->arch.hvm_svm.core = core;
     clear_bit(ARCH_SVM_VMCB_ASSIGN_ASID, &v->arch.hvm_svm.flags);
-    if(!asidpool_assign_next(vmcb, 0, core, core)) {
+    if ( !asidpool_assign_next(vmcb, 0, core, core) )
         BUG();
-    }
 
     if (v->vcpu_id == 0)
         hvm_setup_platform(v->domain);
@@ -446,15 +445,13 @@
         pt = pagetable_get_paddr(v->domain->arch.phys_table);
         printk("%s: phys_table   = %lx\n", __func__, pt);
     }
-    
-    if (svm_paging_enabled(v))
-    {
+
+    shadow_direct_map_init(v);
+
+    if ( svm_paging_enabled(v) )
         vmcb->cr3 = pagetable_get_paddr(v->arch.guest_table);
-    }
     else
-    {
         vmcb->cr3 = pagetable_get_paddr(v->domain->arch.phys_table);
-    }
 
     if (svm_dbg_on) 
     {

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