[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 2/6] svm: Improve type of cpu_has_svm_feature
On Mon, Feb 19, 2024 at 10:03 PM Jan Beulich <jbeulich@xxxxxxxx> wrote: > > On 06.02.2024 02:20, George Dunlap wrote: > > The "effective type" of the cpu_has_svm_feature macro is effectively > > an unsigned log with one bit set (or not); at least one place someone > > felt compelled to do a !! to make sure that they got a boolean out of > > it. > > > > Ideally the whole of this would be folded into the cpufeature.h > > infrastructure. But for now, duplicate the more type-safe static > > inlines in that file, and remove the !!. > > > > Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxx> > > Acked-by: Jan Beulich <jbeulich@xxxxxxxx> > albeit preferably with ... > > > --- a/xen/arch/x86/include/asm/hvm/svm/svm.h > > +++ b/xen/arch/x86/include/asm/hvm/svm/svm.h > > @@ -38,7 +38,10 @@ extern u32 svm_feature_flags; > > #define SVM_FEATURE_SSS 19 /* NPT Supervisor Shadow Stacks */ > > #define SVM_FEATURE_SPEC_CTRL 20 /* MSR_SPEC_CTRL virtualisation */ > > > > -#define cpu_has_svm_feature(f) (svm_feature_flags & (1u << (f))) > > +static inline bool cpu_has_svm_feature(unsigned int feat) > > +{ > > + return svm_feature_flags & (1u << (feat)); > > ... the inner pair of parentheses dropped. Done, thanks. -George
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |