[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d92b9fea-95b6-73ce-c3b5-47dad95c5d42@redhat.com>
Date: Sat, 25 Apr 2020 15:26:30 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>,
Yang Weijiang <weijiang.yang@...el.com>
Cc: 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 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?
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