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@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2023-11-27 15:18:48 +01:00
1 parent 17754972fa
commit 72d51813d6
1 file changed
+4 -2
+4 -2
View File
@@ -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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.