[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86: amend cpu_has_xen_{ibt,shstk}



commit 72d51813d631fe27d37736b7a55eeec08f246983
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Nov 27 15:18:48 2023 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 27 15:18:48 2023 +0100

    x86: amend cpu_has_xen_{ibt,shstk}
    
    ... to evaluate to false at compile-time when the respective Kconfig
    control is off, thus allowing the compiler to eliminate then-dead code.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/include/asm/cpufeature.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpufeature.h 
b/xen/arch/x86/include/asm/cpufeature.h
index 06e1dd7f33..1aa221eb52 100644
--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -215,8 +215,10 @@ static inline bool boot_cpu_has(unsigned int feat)
 #define cpu_has_lfence_dispatch boot_cpu_has(X86_FEATURE_LFENCE_DISPATCH)
 #define cpu_has_nscb            boot_cpu_has(X86_FEATURE_NSCB)
 #define cpu_has_xen_lbr         boot_cpu_has(X86_FEATURE_XEN_LBR)
-#define cpu_has_xen_shstk       boot_cpu_has(X86_FEATURE_XEN_SHSTK)
-#define cpu_has_xen_ibt         boot_cpu_has(X86_FEATURE_XEN_IBT)
+#define cpu_has_xen_shstk       (IS_ENABLED(CONFIG_XEN_SHSTK) && \
+                                 boot_cpu_has(X86_FEATURE_XEN_SHSTK))
+#define cpu_has_xen_ibt         (IS_ENABLED(CONFIG_XEN_IBT) && \
+                                 boot_cpu_has(X86_FEATURE_XEN_IBT))
 
 #define cpu_has_msr_tsc_aux     (cpu_has_rdtscp || cpu_has_rdpid)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.