lkml.org 
[lkml]   [2022]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: x86: optimize PKU branching in kvm_load_{guest|host}_xsave_state
On Mon, Mar 28, 2022, Jon Kohler wrote:
>
>
> > On Mar 27, 2022, at 6:43 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > On 3/26/22 02:37, Jon Kohler wrote:
> >>>> Flip the ordering of the || condition so that XFEATURE_MASK_PKRU is
> >>>> checked first, which when instrumented in our environment appeared
> >>>> to be always true and less overall work than kvm_read_cr4_bits.
> >>>
> >>> If it's always true, then it should be checked last, not first. And if
> >> Sean thanks for the review. This would be a left handed || short circuit, so
> >> wouldn’t we want always true to be first?
> >
> > Yes.
>
> Ack, thanks.

Yeah, I lost track of whether it was a || or &&.

\
 
 \ /
  Last update: 2022-03-28 16:52    [W:0.061 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site