lkml.org 
[lkml]   [2016]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: [Patch v11 4/5] x86/cpufeature: enable RING3MWAIT for Knights Landing
On Thu, 22 Dec 2016, Andrejczuk, Grzegorz wrote:

> >It also warns on the 64bit build.
>
> It is, I missed it. I changed the type of elf_hwcap2 to long unsigned int.

Changing types to match is the proper solution to all problems? You cannot
just change types to make the compiler happy. You have to check what type
is expected for it in the places which consume it, including compat mode.

> >> I used set_bit because I wanted to be sure that this operation to be
> >> done atomically. There might be data race when multiple values of
> >> ELF_HWCAP2 will be set by multiple threads.
> >
> > Touching ELF_HWCAP2 from anything else than the boot cpu is pointless
> > anyway. This should be done once.
>
> MSR (0x140) is thread specific it has to be set for all physical
> threads. Also the kernel parameters are handled after boot cpu is
> initialized and this make disabling harder.

What has the MSR to do with ELF_HWCAP2? ELF_HWCAP2 is a system global
variable. The MSR is of course per hardware thread.

> > Aside of that CPU bringup and therefor the call to init_intel() is
> > serialized by the cpu hotplug code and if we lift that, then ELF_HWCAP2
> > will be the least of our worries.

CPU bringup is serialized, i.e. init_intel() cannot run concurrently on
different CPUs.

If we would remove that serialization then we would have more serious
problems than the concurrent access to ELF_HWCAP2.

Thanks,

tglx

\
 
 \ /
  Last update: 2016-12-22 15:24    [W:0.071 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site