mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Andrejczuk, Grzegorz" <grzegorz.andrejczuk@intel.com>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Luc, Piotr" <Piotr.Luc@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>
Subject: RE: [Patch v11 4/5] x86/cpufeature: enable RING3MWAIT for Knights Landing
Date: Thu, 22 Dec 2016 15:20:54 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1612221509430.3426@nanos> (raw)
In-Reply-To: <ED52C51D9B87F54892CE544909A13C6C1FF98295@IRSMSX101.ger.corp.intel.com>

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

  reply	other threads:[~2016-12-22 14:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-20 13:48 [PATCH v11 0/5] Enabling Ring 3 MONITOR/MWAIT feature " Grzegorz Andrejczuk
2016-12-20 13:48 ` [PATCH v11 1/5] x86/msr: add MSR_MISC_FEATURE_ENABLES and RING3MWAIT bit Grzegorz Andrejczuk
2016-12-21 20:23   ` Thomas Gleixner
2016-12-22  9:10     ` Andrejczuk, Grzegorz
2016-12-20 13:48 ` [PATCH v11 2/5] x86/elf: add HWCAP2 to expose ring 3 MONITOR/MWAIT Grzegorz Andrejczuk
2016-12-20 13:48 ` [PATCH v11 3/5] x86/cpufeature: add RING3MWAIT to CPU features Grzegorz Andrejczuk
2016-12-20 13:48 ` [PATCH v11 4/5] x86/cpufeature: enable RING3MWAIT for Knights Landing Grzegorz Andrejczuk
2016-12-20 18:31   ` [Patch " Grzegorz Andrejczuk
2016-12-21 20:24     ` Thomas Gleixner
2016-12-22 10:19       ` Andrejczuk, Grzegorz
2016-12-22 11:05         ` Thomas Gleixner
2016-12-22 11:37           ` Andrejczuk, Grzegorz
2016-12-22 14:20             ` Thomas Gleixner [this message]
2016-12-23 18:19               ` Andrejczuk, Grzegorz
2016-12-20 13:48 ` [PATCH v11 5/5] x86/cpufeature: enable RING3MWAIT for Knights Mill Grzegorz Andrejczuk
2017-01-03 22:09 ` [PATCH v11 0/5] Enabling Ring 3 MONITOR/MWAIT feature for Knights Landing Pavel Machek
2017-01-09  8:59   ` Thomas Gleixner
2017-01-09  9:12     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1612221509430.3426@nanos \
    --to=tglx@linutronix.de \
    --cc=Piotr.Luc@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=grzegorz.andrejczuk@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®