WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix up the new non-paging direct_map shadow pagetable mode
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 03 Feb 2006 19:24:21 +0000
Delivery-date: Fri, 03 Feb 2006 19:37:19 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix up the new non-paging direct_map shadow pagetable mode, Xen patchbot -unstable <=