[llvmlinux] "KVM: x86: generalize guest_cpuid_has_ helpers" breaks clang
dvyukov at google.com
Tue Sep 12 14:42:56 UTC 2017
I've just noticed that your commit "KVM: x86: generalize
guest_cpuid_has_ helpers" breaks clang build on this assert:
static __always_inline struct cpuid_reg x86_feature_cpuid(unsigned x86_feature)
unsigned x86_leaf = x86_feature / 32;
In clang __builtin_constant_p is never true for function arguments,
it's true only for compile-time constants (what you can use as stack
array size, or C++ template argument). What would work is an
additional macro along the lines of:
#define x86_feature_cpuid(x) (BUILD_BUG_ON(!__builtin_constant_p(x),
But again assuming that caller pass the constant directly.
Could you please fix it?
More information about the LLVMLinux