]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: SEV: Move standard VM-scoped helpers to detect SEV+ guests to sev.c
authorSean Christopherson <seanjc@google.com>
Tue, 10 Mar 2026 23:48:18 +0000 (16:48 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 8 Apr 2026 23:04:26 +0000 (16:04 -0700)
Now that all external usage of the VM-scoped APIs to detect SEV+ guests is
gone, drop the stubs provided for CONFIG_KVM_AMD_SEV=n builds and bury the
"standard" APIs in sev.c.

No functional change intended.

Link: https://patch.msgid.link/20260310234829.2608037-11-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.h

index f36c6694247c6e0995baa221a9d89c874f4430d0..56ace27f739c6cf52028053534de991e84e57f78 100644 (file)
@@ -107,6 +107,20 @@ static unsigned int nr_asids;
 static unsigned long *sev_asid_bitmap;
 static unsigned long *sev_reclaim_asid_bitmap;
 
+static bool sev_guest(struct kvm *kvm)
+{
+       return ____sev_guest(kvm);
+}
+static bool sev_es_guest(struct kvm *kvm)
+{
+       return ____sev_es_guest(kvm);
+}
+
+static bool sev_snp_guest(struct kvm *kvm)
+{
+       return ____sev_snp_guest(kvm);
+}
+
 static int snp_decommission_context(struct kvm *kvm);
 
 struct enc_region {
index f14e2fe551cd3602dcde70d2e9d2b37d2777c995..4c841e330aaf34c158e46721107cbb4f9fcc735d 100644 (file)
@@ -390,20 +390,6 @@ static __always_inline bool ____sev_snp_guest(struct kvm *kvm)
               !WARN_ON_ONCE(!____sev_es_guest(kvm));
 }
 
-static __always_inline bool sev_guest(struct kvm *kvm)
-{
-       return ____sev_guest(kvm);
-}
-static __always_inline bool sev_es_guest(struct kvm *kvm)
-{
-       return ____sev_es_guest(kvm);
-}
-
-static __always_inline bool sev_snp_guest(struct kvm *kvm)
-{
-       return ____sev_snp_guest(kvm);
-}
-
 static __always_inline bool is_sev_guest(struct kvm_vcpu *vcpu)
 {
        return ____sev_guest(vcpu->kvm);
@@ -418,9 +404,6 @@ static __always_inline bool is_sev_snp_guest(struct kvm_vcpu *vcpu)
        return ____sev_snp_guest(vcpu->kvm);
 }
 #else
-#define sev_guest(kvm) false
-#define sev_es_guest(kvm) false
-#define sev_snp_guest(kvm) false
 #define is_sev_guest(vcpu) false
 #define is_sev_es_guest(vcpu) false
 #define is_sev_snp_guest(vcpu) false