[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E7E5BE72-C3AB-4ABB-93B5-EF040595442E@intel.com>
Date: Fri, 15 Jan 2021 19:47:38 +0000
From: "Bae, Chang Seok" <chang.seok.bae@...el.com>
To: Borislav Petkov <bp@...e.de>
CC: Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, x86-ml <x86@...nel.org>,
"Brown, Len" <len.brown@...el.com>,
"Hansen, Dave" <dave.hansen@...el.com>,
"Liu, Jing2" <jing2.liu@...el.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 05/21] x86/fpu/xstate: Add a new variable to indicate
dynamic user states
On Jan 15, 2021, at 05:39, Borislav Petkov <bp@...e.de> wrote:
> On Wed, Dec 23, 2020 at 07:57:01AM -0800, Chang S. Bae wrote:
>> The perf has a buffer that is allocated on demand. The states saved in the
>
> What's "the perf"? I hope to find out when I countinue reading…
Maybe it was better to write ‘Linux perf (tools)’ [1] here. Sorry for the
confusion.
>> diff --git a/arch/x86/include/asm/fpu/xstate.h b/arch/x86/include/asm/fpu/xstate.h
>> index 24bf8d3f559a..6ce8350672c2 100644
>> --- a/arch/x86/include/asm/fpu/xstate.h
>> +++ b/arch/x86/include/asm/fpu/xstate.h
>> @@ -56,7 +56,7 @@
>> * - Don't set the bit corresponding to the dynamic supervisor feature in
>> * IA32_XSS at run time, since it has been set at boot time.
>> */
>> -#define XFEATURE_MASK_DYNAMIC (XFEATURE_MASK_LBR)
>> +#define XFEATURE_MASK_SUPERVISOR_DYNAMIC (XFEATURE_MASK_LBR)
>
> Is XFEATURE_MASK_USER_DYNAMIC coming too?
Instead of the new define, I thought the new variable --
xfeatures_mask_user_dynamic, as its value needs to be determined at boot
time.
PATCH13/21 has the routine:
xfeatures_mask_all &= fpu__get_supported_xfeatures_mask();
- /* Do not support the dynamically allocated buffer yet. */
xfeatures_mask_user_dynamic = 0;
+ for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {
+ u64 feature_mask = BIT_ULL(i);
+
+ if (!(xfeatures_mask_user() & feature_mask))
+ continue;
+
+ if (xfeature_disable_supported(i))
+ xfeatures_mask_user_dynamic |= feature_mask;
+ }
+
Thanks,
Chang
[1] https://en.wikipedia.org/wiki/Perf_(Linux)
Powered by blists - more mailing lists