lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200801031353.59426.ak@suse.de>
Date:	Thu, 3 Jan 2008 13:53:59 +0100
From:	Andi Kleen <ak@...e.de>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	andreas.herrmann3@....com, linux-kernel@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] [11/20] x86: Use the correct cpuid method to detect MWAIT support for C states

On Thursday 03 January 2008 11:45:26 Ingo Molnar wrote:
> 
> * Andi Kleen <ak@...e.de> wrote:
> 
> > +static int mwait_usable(const struct cpuinfo_x86 *c)
> > +{
> > +	if (force_mwait)
> > +		return 1;
> > +	/* Any C1 states supported? */
> > +	return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
> > +}
> > +
> >  void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
> >  {
> > -	if (cpu_has(c, X86_FEATURE_MWAIT)) {
> > +	if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
> >  		printk("monitor/mwait feature present.\n");
> 
> hm, why not clear FEATURE_MWAIT if it's "not usable"? That's the 
> standard approach we do for CPU features that do not work.

Well it works, just in a unexpected way not useful to the kernel.

At least on AMD there is a bit to enable it for ring 3 too, so 
in theory someone could use it anyways.

-Andi

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ