Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: SVM: Check for an unexpected VM-Exit after RETPOLINE "fast" handling

Check for an unexpected/unhandled VM-Exit after the manual RETPOLINE=y
handling. The entire point of the RETPOLINE checks is to optimize for
common VM-Exits, i.e. checking for the rare case of an unsupported
VM-Exit is counter-productive. This also aligns SVM and VMX exit handling.

No functional change intended.

Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20251230211347.4099600-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

+6 -6
+6 -6
arch/x86/kvm/svm/svm.c
··· 3469 3469 3470 3470 int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code) 3471 3471 { 3472 - if (exit_code >= ARRAY_SIZE(svm_exit_handlers)) 3473 - goto unexpected_vmexit; 3474 - 3475 - if (!svm_exit_handlers[exit_code]) 3476 - goto unexpected_vmexit; 3477 - 3478 3472 #ifdef CONFIG_MITIGATION_RETPOLINE 3479 3473 if (exit_code == SVM_EXIT_MSR) 3480 3474 return msr_interception(vcpu); ··· 3485 3491 return sev_handle_vmgexit(vcpu); 3486 3492 #endif 3487 3493 #endif 3494 + if (exit_code >= ARRAY_SIZE(svm_exit_handlers)) 3495 + goto unexpected_vmexit; 3496 + 3497 + if (!svm_exit_handlers[exit_code]) 3498 + goto unexpected_vmexit; 3499 + 3488 3500 return svm_exit_handlers[exit_code](vcpu); 3489 3501 3490 3502 unexpected_vmexit: