@@ -616,7 +616,9 @@ static void __vcpu_clear(void *arg)
vmcs_clear(vmx->vmcs);
if (per_cpu(current_vmcs, cpu) == vmx->vmcs)
per_cpu(current_vmcs, cpu) = NULL;
- list_del(&vmx->local_vcpus_link);
+ /* TODO: currently, local_vcpus_link is just for L1 VMCSs */
+ if (!is_guest_mode(&vmx->vcpu))
+ list_del(&vmx->local_vcpus_link);
vmx->vcpu.cpu = -1;
vmx->launched = 0;
}
@@ -1022,8 +1024,10 @@ static void vmx_vcpu_load(struct kvm_vcp
kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
local_irq_disable();
- list_add(&vmx->local_vcpus_link,
- &per_cpu(vcpus_on_cpu, cpu));
+ /* TODO: currently, local_vcpus_link is just for L1 VMCSs */
+ if (!is_guest_mode(&vmx->vcpu))
+ list_add(&vmx->local_vcpus_link,
+ &per_cpu(vcpus_on_cpu, cpu));
local_irq_enable();
/*
@@ -1647,7 +1651,9 @@ static void vmclear_local_vcpus(void)
list_for_each_entry_safe(vmx, n, &per_cpu(vcpus_on_cpu, cpu),
local_vcpus_link)
- __vcpu_clear(vmx);
+ /* TODO: currently, local_vcpus_link is just for L1 VMCSs */
+ if (!is_guest_mode(&vmx->vcpu))
+ __vcpu_clear(vmx);
}