Skip to content

Commit 5868b82

Browse files
Maxim Levitskybonzini
authored andcommitted
KVM: SVM: use vmcb01 in svm_refresh_apicv_exec_ctrl
Currently when SVM is enabled in guest CPUID, AVIC is inhibited as soon as the guest CPUID is set. AVIC happens to be fully disabled on all vCPUs by the time any guest entry starts (if after migration the entry can be nested). The reason is that currently we disable avic right away on vCPU from which the kvm_request_apicv_update was called and for this case, it happens to be called on all vCPUs (by svm_vcpu_after_set_cpuid). After we stop doing this, AVIC will end up being disabled only when KVM_REQ_APICV_UPDATE is processed which is after we done switching to the nested guest. Fix this by just using vmcb01 in svm_refresh_apicv_exec_ctrl for avic (which is a right thing to do anyway). Signed-off-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent feea013 commit 5868b82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/svm/avic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ static int svm_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
646646
void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
647647
{
648648
struct vcpu_svm *svm = to_svm(vcpu);
649-
struct vmcb *vmcb = svm->vmcb;
649+
struct vmcb *vmcb = svm->vmcb01.ptr;
650650
bool activated = kvm_vcpu_apicv_active(vcpu);
651651

652652
if (!enable_apicv)

0 commit comments

Comments
 (0)