Skip to content

Commit aaca210

Browse files
haiwei-libonzini
authored andcommitted
KVM: SVM: Fix the svm vmexit code for WRMSR
In svm, exit_code for MSR writes is not EXIT_REASON_MSR_WRITE which belongs to vmx. According to amd manual, SVM_EXIT_MSR(7ch) is the exit_code of VMEXIT_MSR due to RDMSR or WRMSR access to protected MSR. Additionally, the processor indicates in the VMCB's EXITINFO1 whether a RDMSR(EXITINFO1=0) or WRMSR(EXITINFO1=1) was intercepted. Signed-off-by: Haiwei Li <[email protected]> Fixes: 1e9e262 ("KVM: VMX: FIXED+PHYSICAL mode single target IPI fastpath", 2019-11-21) Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 9a11997 commit aaca210

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kvm/svm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6312,7 +6312,8 @@ static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu,
63126312
enum exit_fastpath_completion *exit_fastpath)
63136313
{
63146314
if (!is_guest_mode(vcpu) &&
6315-
to_svm(vcpu)->vmcb->control.exit_code == EXIT_REASON_MSR_WRITE)
6315+
to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
6316+
to_svm(vcpu)->vmcb->control.exit_info_1)
63166317
*exit_fastpath = handle_fastpath_set_msr_irqoff(vcpu);
63176318
}
63186319

0 commit comments

Comments
 (0)