]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/sev: Indicate the SEV-SNP guest supports Secure AVIC
authorNeeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Thu, 28 Aug 2025 11:32:24 +0000 (17:02 +0530)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 1 Sep 2025 11:20:53 +0000 (13:20 +0200)
Now that Secure AVIC support is complete, make it part of to the SNP present
features.

Co-developed-by: Kishon Vijay Abraham I <kvijayab@amd.com>
Signed-off-by: Kishon Vijay Abraham I <kvijayab@amd.com>
Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Link: https://lore.kernel.org/20250828113225.209174-1-Neeraj.Upadhyay@amd.com
arch/x86/boot/compressed/sev.c

index 74e083feb2d9528f7819d2dfc04f23300ab174dc..048d3e8839c3b9f0814727a34c91b80b2e8c323f 100644 (file)
@@ -238,13 +238,20 @@ bool sev_es_check_ghcb_fault(unsigned long address)
                                 MSR_AMD64_SNP_SECURE_AVIC |            \
                                 MSR_AMD64_SNP_RESERVED_MASK)
 
+#ifdef CONFIG_AMD_SECURE_AVIC
+#define SNP_FEATURE_SECURE_AVIC                MSR_AMD64_SNP_SECURE_AVIC
+#else
+#define SNP_FEATURE_SECURE_AVIC                0
+#endif
+
 /*
  * SNP_FEATURES_PRESENT is the mask of SNP features that are implemented
  * by the guest kernel. As and when a new feature is implemented in the
  * guest kernel, a corresponding bit should be added to the mask.
  */
 #define SNP_FEATURES_PRESENT   (MSR_AMD64_SNP_DEBUG_SWAP |     \
-                                MSR_AMD64_SNP_SECURE_TSC)
+                                MSR_AMD64_SNP_SECURE_TSC |     \
+                                SNP_FEATURE_SECURE_AVIC)
 
 u64 snp_get_unsupported_features(u64 status)
 {