Skip to content

Commit bb5081f

Browse files
flying-122sean-jc
authored andcommitted
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: Peng Hao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent b6bc164 commit bb5081f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3626,6 +3626,10 @@ int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code)
36263626
return kvm_emulate_halt(vcpu);
36273627
else if (exit_code == SVM_EXIT_NPF)
36283628
return npf_interception(vcpu);
3629+
#ifdef CONFIG_KVM_AMD_SEV
3630+
else if (exit_code == SVM_EXIT_VMGEXIT)
3631+
return sev_handle_vmgexit(vcpu);
3632+
#endif
36293633
#endif
36303634
return svm_exit_handlers[exit_code](vcpu);
36313635
}

0 commit comments

Comments
 (0)