[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c95b6ade-2cc9-e065-01ab-b449dd846c50@intel.com>
Date: Mon, 22 Jun 2020 08:02:44 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Liang, Kan" <kan.liang@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...hat.com, acme@...nel.org, tglx@...utronix.de,
bp@...en8.de, x86@...nel.org, linux-kernel@...r.kernel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...hat.com, namhyung@...nel.org, yu-cheng.yu@...el.com,
bigeasy@...utronix.de, gorcunov@...il.com, hpa@...or.com,
alexey.budankov@...ux.intel.com, eranian@...gle.com,
ak@...ux.intel.com, like.xu@...ux.intel.com,
yao.jin@...ux.intel.com
Subject: Re: [PATCH 17/21] x86/fpu: Use proper mask to replace full
instruction mask
On 6/22/20 7:52 AM, Liang, Kan wrote:
>>> --- a/arch/x86/kernel/fpu/xstate.c
>>> +++ b/arch/x86/kernel/fpu/xstate.c
>>> @@ -58,6 +58,7 @@ static short xsave_cpuid_features[] __initdata = {
>>> * XSAVE buffer, both supervisor and user xstates.
>>> */
>>> u64 xfeatures_mask_all __read_mostly;
>>> +EXPORT_SYMBOL_GPL(xfeatures_mask_all);
>>
>> *groan*...
>>
>> AFAICT KVM doesn't actually use any of those functions,
>
> It seems KVM may eventually invoke copy_xregs_to_kernel() as below.
>
> kvm_save_current_fpu()
> copy_fpregs_to_fpstate()
> copy_xregs_to_kernel()
>
> I think we have to export the xfeatures_mask_all.
I'm wondering if we should just take these copy_*regs_to_*() functions
and uninline them. Yeah, they are basically wrapping one instruction,
but it might literally be the most heavyweight instruction in the whole ISA.
Or, maybe just make an out-of-line version for KVM to call?
Powered by blists - more mailing lists