On 17.07.2023 14:35, Jason Andryuk wrote: > On Wed, Jul 12, 2023 at 8:36 AM Jan Beulich <[email protected]> wrote: >> >> Certain fallback code can be made subject to DCE this way. Note that >> CX16 has no compiler provided manifest constant, so CONFIG_* are used >> there instead. Note also that we don't have cpu_has_movbe nor >> cpu_has_lzcnt (aka cpu_has_abm). >> >> Signed-off-by: Jan Beulich <[email protected]> > > Reviewed-by: Jason Andryuk <[email protected]>
Thanks. >> --- a/xen/arch/x86/include/asm/cpufeature.h >> +++ b/xen/arch/x86/include/asm/cpufeature.h >> @@ -76,13 +76,19 @@ static inline bool boot_cpu_has(unsigned >> #define cpu_has_eist boot_cpu_has(X86_FEATURE_EIST) >> #define cpu_has_ssse3 boot_cpu_has(X86_FEATURE_SSSE3) >> #define cpu_has_fma boot_cpu_has(X86_FEATURE_FMA) >> -#define cpu_has_cx16 boot_cpu_has(X86_FEATURE_CX16) >> +#define cpu_has_cx16 (IS_ENABLED(CONFIG_X86_64_V2) || \ >> + IS_ENABLED(CONFIG_X86_64_V3) || \ >> + boot_cpu_has(X86_FEATURE_CX16)) > > If you think there may be more ABI selections in the future, it might > be better to express the "V$N" numerically and check >= 2. Or you can > add a Kconfig CONFIG_X86_64_CX16 and select that as appropriate. But > if there aren't going to be more of these, then this is fine. I was thinking this same way: If more appear (which aren't SIMD-only, like v4 is), we can use a numeric CONFIG_*, but for now it's good enough (and slightly simpler) this way. Jan
