lkml.org 
[lkml]   [2023]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 07/21] KVM: x86: Add a framework for enabling KVM-governed x86 features
From
On Mon, Aug 14, 2023, Zeng Guang wrote:
>
> On 7/29/2023 9:15 AM, Sean Christopherson wrote:
> > +static __always_inline int kvm_governed_feature_index(unsigned int x86_feature)
> > +{
> > + switch (x86_feature) {
> > +#define KVM_GOVERNED_FEATURE(x) case x: return KVM_GOVERNED_##x;
> > +#include "governed_features.h"
> > + default:
> > + return -1;
> > + }
> > +}
> > +
> > +static __always_inline int kvm_is_governed_feature(unsigned int x86_feature)
> > +{
> > + return kvm_governed_feature_index(x86_feature) >= 0;
> > +}
> > +
>
> I think it proper to return a bool, not "int" instead.

Yeah. I'm pretty sure someone brought this up in v1 too, and I spaced on it.

\
 
 \ /
  Last update: 2023-08-14 19:21    [W:0.135 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site