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] [xen-unstable] [SVM] Don't free HSA and root vmcb when d

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [SVM] Don't free HSA and root vmcb when disabling SVM
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Mar 2007 11:30:26 -0800
Delivery-date: Fri, 09 Mar 2007 11:30:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1173440719 0
# Node ID b46a92ba0b614647debe57e53efc1a023e85bb74
# Parent  c75d1acd18c837ee7fb63bf410a56efbe80b86fe
[SVM] Don't free HSA and root vmcb when disabling SVM
since we're no longer allowed to free pages in an interrupt context.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/svm.c         |   22 ++++++----------------
 xen/arch/x86/hvm/svm/vmcb.c        |    5 -----
 xen/include/asm-x86/hvm/svm/vmcb.h |    1 -
 3 files changed, 6 insertions(+), 22 deletions(-)

diff -r c75d1acd18c8 -r b46a92ba0b61 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri Mar 09 11:14:03 2007 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri Mar 09 11:45:19 2007 +0000
@@ -107,22 +107,10 @@ static void stop_svm(void)
 static void stop_svm(void)
 {
     u32 eax, edx;    
-    int cpu = smp_processor_id();
-
     /* We turn off the EFER_SVME bit. */
     rdmsr(MSR_EFER, eax, edx);
     eax &= ~EFER_SVME;
     wrmsr(MSR_EFER, eax, edx);
- 
-    /* release the HSA */
-    free_host_save_area(hsa[cpu]);
-    hsa[cpu] = NULL;
-    wrmsr(MSR_K8_VM_HSAVE_PA, 0, 0 );
-
-    /* free up the root vmcb */
-    free_vmcb(root_vmcb[cpu]);
-    root_vmcb[cpu] = NULL;
-    root_vmcb_pa[cpu] = 0;
 }
 
 static void svm_store_cpu_guest_regs(
@@ -1058,8 +1046,9 @@ int start_svm(void)
         return 0;
     }
 
-    if (!(hsa[cpu] = alloc_host_save_area()))
-        return 0;
+    if (!hsa[cpu])
+        if (!(hsa[cpu] = alloc_host_save_area()))
+            return 0;
     
     rdmsr(MSR_EFER, eax, edx);
     eax |= EFER_SVME;
@@ -1074,8 +1063,9 @@ int start_svm(void)
     phys_hsa_hi = (u32) (phys_hsa >> 32);    
     wrmsr(MSR_K8_VM_HSAVE_PA, phys_hsa_lo, phys_hsa_hi);
   
-    if (!(root_vmcb[cpu] = alloc_vmcb())) 
-        return 0;
+    if (!root_vmcb[cpu])
+        if (!(root_vmcb[cpu] = alloc_vmcb())) 
+            return 0;
     root_vmcb_pa[cpu] = virt_to_maddr(root_vmcb[cpu]);
 
     if (cpu == 0)
diff -r c75d1acd18c8 -r b46a92ba0b61 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Fri Mar 09 11:14:03 2007 +0000
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Fri Mar 09 11:45:19 2007 +0000
@@ -77,11 +77,6 @@ struct host_save_area *alloc_host_save_a
 
     memset(hsa, 0, PAGE_SIZE);
     return hsa;
-}
-
-void free_host_save_area(struct host_save_area *hsa)
-{
-    free_xenheap_page(hsa);
 }
 
 static int construct_vmcb(struct vcpu *v)
diff -r c75d1acd18c8 -r b46a92ba0b61 xen/include/asm-x86/hvm/svm/vmcb.h
--- a/xen/include/asm-x86/hvm/svm/vmcb.h        Fri Mar 09 11:14:03 2007 +0000
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h        Fri Mar 09 11:45:19 2007 +0000
@@ -460,7 +460,6 @@ struct vmcb_struct *alloc_vmcb(void);
 struct vmcb_struct *alloc_vmcb(void);
 struct host_save_area *alloc_host_save_area(void);
 void free_vmcb(struct vmcb_struct *vmcb);
-void free_host_save_area(struct host_save_area *hsa);
 
 int  svm_create_vmcb(struct vcpu *v);
 void svm_destroy_vmcb(struct vcpu *v);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [SVM] Don't free HSA and root vmcb when disabling SVM, Xen patchbot-unstable <=