Skip to content

Commit

Permalink
KVM: VMX: Don't clear the vmcs if the vcpu is not loaded on any proce…
Browse files Browse the repository at this point in the history
…ssor

Noted by Eddie Dong.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Jan 30, 2008
1 parent b4c6abf commit eae5ecb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ static void __vcpu_clear(void *arg)

static void vcpu_clear(struct vcpu_vmx *vmx)
{
if (vmx->vcpu.cpu != raw_smp_processor_id() && vmx->vcpu.cpu != -1)
if (vmx->vcpu.cpu == -1)
return;
if (vmx->vcpu.cpu != raw_smp_processor_id())
smp_call_function_single(vmx->vcpu.cpu, __vcpu_clear,
vmx, 0, 1);
else
Expand Down

0 comments on commit eae5ecb

Please sign in to comment.