lkml.org 
[lkml]   [2020]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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)));
> >> +}

\
 
 \ /
  Last update: 2020-04-26 17:25    [W:0.069 / U:8.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site