Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600835
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID |
| Date | 2017-03-14 20:20 +0100 |
| Message-ID | <tl09c-4Iz-7@gated-at.bofh.it> (permalink) |
| References | <sBjD3-4ES-11@gated-at.bofh.it> <sBjD3-4ES-15@gated-at.bofh.it> <tkZZv-4D5-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 03/14/17 12:01, H. Peter Anvin wrote:
> On 11/08/16 10:39, Kyle Huey wrote:
>> }
>>
>> + if (test_tsk_thread_flag(prev_p, TIF_NOCPUID) ^
>> + test_tsk_thread_flag(next_p, TIF_NOCPUID)) {
>> + set_cpuid_faulting(test_tsk_thread_flag(next_p, TIF_NOCPUID));
>> + }
>> +
>> if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
>> test_tsk_thread_flag(next_p, TIF_NOTSC)) {
>> /* prev and next are different */
>> if (test_tsk_thread_flag(next_p, TIF_NOTSC))
>> hard_disable_TSC();
>> else
>> hard_enable_TSC();
>> }
>
> I'm unhappy about this part: we already do two XORs on these after bit
> extraction, which is quite inefficient; and at least theoretically we
> could be indirecting though the ->stack pointer for every one if gcc
> can't tell it won't have changed (we really need to get thread_info
> moved into the task_struct allocation and away from the kernel stack,
> especially since on x86 the pointer is the same size as the vestigial
> structure it points to.)
>
Nevermind, I was accidentally looking at v10 not v15 of this patchset.
My bad.
-hpa
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID "H. Peter Anvin" <hpa@zytor.com> - 2017-03-14 20:10 +0100
Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID Kyle Huey <me@kylehuey.com> - 2017-03-14 20:10 +0100
Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID "H. Peter Anvin" <hpa@zytor.com> - 2017-03-14 21:20 +0100
Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID "H. Peter Anvin" <hpa@zytor.com> - 2017-03-14 20:20 +0100
Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID Andy Lutomirski <luto@amacapital.net> - 2017-03-14 20:30 +0100
Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID "H. Peter Anvin" <hpa@zytor.com> - 2017-03-15 10:20 +0100
csiph-web