From: kaf24@firebug.cl.cam.ac.uk Date: Mon, 3 Jul 2006 07:27:50 +0000 (+0100) Subject: [HVM][VMX] Fixes to VMCS create/destroy. X-Git-Tag: 3.0.3-branched~659^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=402e6028307a7d7bc0fc82cfc0832f79689b6a9c;p=xen.git [HVM][VMX] Fixes to VMCS create/destroy. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index 8d498d2d03..b4568342d1 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -36,6 +36,7 @@ #include #include #include + #if CONFIG_PAGING_LEVELS >= 3 #include #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);