[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E9EC06E-4575-44AA-89BC-619439385521@nutanix.com>
Date: Fri, 7 May 2021 17:13:36 +0000
From: Jon Kohler <jon@...anix.com>
To: Dave Hansen <dave.hansen@...el.com>
CC: Paolo Bonzini <pbonzini@...hat.com>, Jon Kohler <jon@...anix.com>,
Babu Moger <babu.moger@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"x86@...nel.org" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Fenghua Yu <fenghua.yu@...el.com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>,
Tony Luck <tony.luck@...el.com>,
Uros Bizjak <ubizjak@...il.com>,
Petteri Aimonen <jpa@....mail.kapsi.fi>,
Kan Liang <kan.liang@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Rapoport <rppt@...nel.org>,
Benjamin Thiel <b.thiel@...teo.de>,
Fan Yang <Fan_Yang@...u.edu.cn>,
Juergen Gross <jgross@...e.com>,
Dave Jiang <dave.jiang@...el.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
Arvind Sankar <nivedita@...m.mit.edu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: Re: [PATCH] KVM: x86: add hint to skip hidden rdpkru under
kvm_load_host_xsave_state
> On May 7, 2021, at 12:58 PM, Dave Hansen <dave.hansen@...el.com> wrote:
>
> On 5/7/21 9:52 AM, Paolo Bonzini wrote:
>> This can be optimized as well, can't it? This means that the only case
>> that needs the rdpkru is in switch_fpu_finish, and __write_pkru can be
>> removed completely:
>>
>> - do the rdpkru+wrpkru in switch_fpu_finish
>>
>> - just use wrpkru in KVM
>
> I was going to suggest exactly the same thing. It doesn't require the
> compiler to be smart, and wrpkru() is available in the same header as
> __write_pkru().
Thanks Paolo, Dave. Good suggestion, I’ll work up a v2 and send it out.
>
> I also detest the mysterious true/false arguments to functions where you
> have no clue what they're doing at the call site without comments.
Noted, my apologies. Thats a good point, I won’t make that mistake again.
Powered by blists - more mailing lists