]> xenbits.xensource.com Git - xen.git/commitdiff
[HVM][VMX] Fixes to VMCS create/destroy.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 3 Jul 2006 07:27:50 +0000 (08:27 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 3 Jul 2006 07:27:50 +0000 (08:27 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/vmx/vmcs.c

index 8d498d2d0321c357acfa31fead38fd59e9b9416b..b4568342d1dcc814a3911a06f283a97269db3b4e 100644 (file)
@@ -36,6 +36,7 @@
 #include <xen/kernel.h>
 #include <asm/shadow.h>
 #include <xen/keyhandler.h>
+
 #if CONFIG_PAGING_LEVELS >= 3
 #include <asm/shadow_64.h>
 #endif
@@ -440,7 +441,6 @@ static int construct_vmcs(struct vcpu *v,
     memset(arch_vmx, 0, sizeof(struct arch_vmx_struct));
 
     spin_lock_init(&arch_vmx->vmcs_lock);
-    arch_vmx->active_cpu = -1;
 
     /*
      * Create a new VMCS
@@ -450,7 +450,7 @@ static int construct_vmcs(struct vcpu *v,
         return -ENOMEM;
     }
 
-    vmx_clear_vmcs(v);
+    __vmx_clear_vmcs(v);
     vmx_load_vmcs(v);
 
     if ((error = construct_vmcs_controls(arch_vmx))) {
@@ -496,6 +496,9 @@ void vmx_destroy_vmcs(struct vcpu *v)
 {
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
 
+    if ( arch_vmx->vmcs == NULL )
+        return;
+
     vmx_clear_vmcs(v);
 
     free_vmcs(arch_vmx->vmcs);