[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200426152600.GC29493@local-michael-cet-test.sh.intel.com>
Date: Sun, 26 Apr 2020 23:26:01 +0800
From: Yang Weijiang <weijiang.yang@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Sean Christopherson <sean.j.christopherson@...el.com>,
Yang Weijiang <weijiang.yang@...el.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, jmattson@...gle.com,
yu.c.zhang@...ux.intel.com
Subject: Re: [PATCH v11 2/9] KVM: VMX: Set guest CET MSRs per KVM and host
configuration
On Sat, Apr 25, 2020 at 03:26:30PM +0200, Paolo Bonzini wrote:
> On 23/04/20 18:27, Sean Christopherson wrote:
> >>
> >> +static bool is_cet_mode_allowed(struct kvm_vcpu *vcpu, u32 mode_mask)
> > CET itself isn't a mode. And since this ends up being an inner helper for
> > is_cet_supported(), I think __is_cet_supported() would be the way to go.
> >
> > Even @mode_mask is a bit confusing without the context of it being kernel
> > vs. user. The callers are very readable, e.g. I'd much prefer passing the
> > mask as opposed to doing 'bool kernel'. Maybe s/mode_mask/cet_mask? That
> > doesn't exactly make things super clear, but at least the reader knows the
> > mask is for CET features.
>
> What about is_cet_state_supported and xss_states?
>
It's good for me, I'll change them accordingly, thank you for review!
> Paolo
>
> >> +{
> >> + return ((supported_xss & mode_mask) &&
> >> + (guest_cpuid_has(vcpu, X86_FEATURE_SHSTK) ||
> >> + guest_cpuid_has(vcpu, X86_FEATURE_IBT)));
> >> +}
Powered by blists - more mailing lists