[tip: x86/sev] x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled()

tip-bot2 for Borislav Petkov (AMD) posted 1 patch 2 months, 4 weeks ago
arch/x86/boot/startup/sev-shared.c | 2 +-
arch/x86/coco/sev/vc-handle.c      | 1 -
arch/x86/coco/sev/vc-shared.c      | 2 +-
arch/x86/lib/kaslr.c               | 2 +-
4 files changed, 3 insertions(+), 4 deletions(-)
[tip: x86/sev] x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled()
Posted by tip-bot2 for Borislav Petkov (AMD) 2 months, 4 weeks ago
The following commit has been merged into the x86/sev branch of tip:

Commit-ID:     b2c1dd6c6f70a5a519532227358c82d4cfda5b36
Gitweb:        https://git.kernel.org/tip/b2c1dd6c6f70a5a519532227358c82d4cfda5b36
Author:        Borislav Petkov (AMD) <bp@alien8.de>
AuthorDate:    Thu, 30 Oct 2025 17:59:11 +01:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 11 Nov 2025 16:42:31 +01:00

x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled()

Drop one redundant definition, while at it.

There should be no functional changes.

Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20251031122122.GKaQSpwhLvkinKKbjG@fat_crate.local
---
 arch/x86/boot/startup/sev-shared.c | 2 +-
 arch/x86/coco/sev/vc-handle.c      | 1 -
 arch/x86/coco/sev/vc-shared.c      | 2 +-
 arch/x86/lib/kaslr.c               | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/sev-shared.c
index 4e22ffd..a0fa8bb 100644
--- a/arch/x86/boot/startup/sev-shared.c
+++ b/arch/x86/boot/startup/sev-shared.c
@@ -12,7 +12,7 @@
 #include <asm/setup_data.h>
 
 #ifndef __BOOT_COMPRESSED
-#define has_cpuflag(f)			boot_cpu_has(f)
+#define has_cpuflag(f)			cpu_feature_enabled(f)
 #else
 #undef WARN
 #define WARN(condition, format...) (!!(condition))
diff --git a/arch/x86/coco/sev/vc-handle.c b/arch/x86/coco/sev/vc-handle.c
index 7fc136a..f08c750 100644
--- a/arch/x86/coco/sev/vc-handle.c
+++ b/arch/x86/coco/sev/vc-handle.c
@@ -352,7 +352,6 @@ fault:
 
 #define sev_printk(fmt, ...)		printk(fmt, ##__VA_ARGS__)
 #define error(v)
-#define has_cpuflag(f)			boot_cpu_has(f)
 
 #include "vc-shared.c"
 
diff --git a/arch/x86/coco/sev/vc-shared.c b/arch/x86/coco/sev/vc-shared.c
index e2ac95d..58b2f98 100644
--- a/arch/x86/coco/sev/vc-shared.c
+++ b/arch/x86/coco/sev/vc-shared.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #ifndef __BOOT_COMPRESSED
-#define has_cpuflag(f)                  boot_cpu_has(f)
+#define has_cpuflag(f)                  cpu_feature_enabled(f)
 #endif
 
 static enum es_result vc_check_opcode_bytes(struct es_em_ctxt *ctxt,
diff --git a/arch/x86/lib/kaslr.c b/arch/x86/lib/kaslr.c
index b589392..8c7cd11 100644
--- a/arch/x86/lib/kaslr.c
+++ b/arch/x86/lib/kaslr.c
@@ -22,7 +22,7 @@
 #include <asm/setup.h>
 
 #define debug_putstr(v) early_printk("%s", v)
-#define has_cpuflag(f) boot_cpu_has(f)
+#define has_cpuflag(f) cpu_feature_enabled(f)
 #define get_boot_seed() kaslr_offset()
 #endif