Commit bb5081f4 authored by Peng Hao's avatar Peng Hao Committed by Sean Christopherson
Browse files

KVM: SVM: avoid frequency indirect calls



When retpoline is enabled, indirect function calls introduce additional
performance overhead. Avoid frequent indirect calls to VMGEXIT when SEV
is enabled.

Signed-off-by: default avatarPeng Hao <flyingpeng@tencent.com>
Link: https://lore.kernel.org/r/20250306075425.66693-1-flyingpeng@tencent.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent b6bc164f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3626,6 +3626,10 @@ int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code)
		return kvm_emulate_halt(vcpu);
	else if (exit_code == SVM_EXIT_NPF)
		return npf_interception(vcpu);
#ifdef CONFIG_KVM_AMD_SEV
	else if (exit_code == SVM_EXIT_VMGEXIT)
		return sev_handle_vmgexit(vcpu);
#endif
#endif
	return svm_exit_handlers[exit_code](vcpu);
}