lkml.org 
[lkml]   [2020]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/3] KVM: VMX: Replace MSR_IA32_RTIT_OUTPUT_BASE_MASK with helper function
On Wed, Sep 23, 2020 at 07:07:22PM +0200, Paolo Bonzini wrote:
> On 23/09/20 18:36, Sean Christopherson wrote:
> > +static inline bool pt_output_base_valid(struct kvm_vcpu *vcpu, u64 base)
> > +{
> > + /* The base must be 128-byte aligned and a legal physical address. */
> > + return !(base & (~((1UL << cpuid_maxphyaddr(vcpu)) - 1) | 0x7f));
> > +}
>
> The fact that you deemed a comment necessary says something already. :)
> What about:
>
> return !kvm_mmu_is_illegal_gpa(vcpu, base) && !(base & 0x7f);
>
> (where this new usage makes it obvious that mmu should have been vcpu).

Ya. I think it was a sort of sunk cost fallacy. Dammit, I spent all that
time figuring out what this code does, I'm keeping it!!!

v3 incoming...

\
 
 \ /
  Last update: 2020-09-24 20:01    [W:0.051 / U:6.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site