From 402e6028307a7d7bc0fc82cfc0832f79689b6a9c Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 3 Jul 2006 08:27:50 +0100 Subject: [PATCH] [HVM][VMX] Fixes to VMCS create/destroy. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/vmx/vmcs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.39.5