KVM: SVM: Wrap __svm_sev_es_vcpu_run() with #ifdef CONFIG_KVM_AMD_SEV
authorSean Christopherson <seanjc@google.com>
Fri, 23 Feb 2024 20:42:27 +0000 (12:42 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 9 Apr 2024 17:20:28 +0000 (10:20 -0700)
commit7774c8f32e99b1f314c0df7c204a897792b4f378
tree3532e38a5100e7033e4bebab1ac9c54530e96870
parent19597a71a0c8603f8c8599686ac9b0ff4b846716
KVM: SVM: Wrap __svm_sev_es_vcpu_run() with #ifdef CONFIG_KVM_AMD_SEV

Compile (and link) __svm_sev_es_vcpu_run() if and only if SEV support is
actually enabled.  This will allow dropping non-existent 32-bit "support"
from __svm_sev_es_vcpu_run() without causing undue confusion.

Intentionally don't provide a stub (but keep the declaration), as any sane
compiler, even with things like KASAN enabled, should eliminate the call
to __svm_sev_es_vcpu_run() since sev_es_guest() unconditionally returns
"false" if CONFIG_KVM_AMD_SEV=n.

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240223204233.3337324-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/vmenter.S