On 16.04.2024 08:46, Sergiy Kibrik wrote: > --- a/xen/arch/x86/include/asm/hvm/svm/svm.h > +++ b/xen/arch/x86/include/asm/hvm/svm/svm.h > @@ -38,10 +38,18 @@ extern u32 svm_feature_flags; > #define SVM_FEATURE_SSS 19 /* NPT Supervisor Shadow Stacks */ > #define SVM_FEATURE_SPEC_CTRL 20 /* MSR_SPEC_CTRL virtualisation */ > > +#ifdef CONFIG_SVM > static inline bool cpu_has_svm_feature(unsigned int feat) > { > return svm_feature_flags & (1u << feat); > } > +#else > +static inline bool cpu_has_svm_feature(unsigned int feat) > +{ > + return false; > +} > +#endif
Already static inline bool cpu_has_svm_feature(unsigned int feat) { #ifdef CONFIG_SVM return svm_feature_flags & (1u << feat); #else return false; #endif } would be less redundancy. But why not simply static inline bool cpu_has_svm_feature(unsigned int feat) { return is_ENABLED(CONFIG_SVM) && (svm_feature_flags & (1u << feat)); } ? Jan