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]
Date:	Mon, 25 May 2015 10:42:14 +0800
From:	Huang Rui <ray.huang@....com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Borislav Petkov <bp@...e.de>, Len Brown <lenb@...nel.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Fengguang Wu <fengguang.wu@...el.com>,
	"Aaron Lu" <aaron.lu@...el.com>, "Li, Tony" <Tony.Li@....com>,
	Andy Lutomirski <luto@...capital.net>
Subject: Re: [RFC PATCH 2/4] x86, mwaitt: introduce mwaitx idle with a
 configurable timer

On Wed, May 20, 2015 at 07:11:20PM +0800, Ingo Molnar wrote:
> 
> * Borislav Petkov <bp@...e.de> wrote:
> 
> > On Wed, May 20, 2015 at 12:22:58PM +0200, Ingo Molnar wrote:
> >
> > > Well, HLT does not get any hint from the OS how long the idling is 
> > > expected to last.
> > 
> > MWAIT on AMD doesn't either:
> 
> Yeah, MWAIT clearly doesn't, but I was talking about MWAITX, which 
> takes a timeout parameter as per these patches.
> 
> > > Another MWAITX round - we've got no crystal ball, so the hint 
> > > might be wrong if an external event occurs that we did not 
> > > anticipate.
> > 
> > So if we end up doing a bunch of MWAITX rounds instead of HLT and 
> > MWAITX saves less power than HLT, then we practically are worse.
> 
> So the way I think it would work ideally is (and note that this is 
> different from how you think it works):
> 
>   - MWAITX takes a 'timeout' parameter, but otherwise behaves exactly 
>     like MWAIT: i.e. once idle it won't exit idle on its own
> 
>   - based on the 'timeout' hint, MWAITX can internally optimize how 
>     deep sleep it enters. If the timeout is large it goes deep, if 
>     it's small, it goes shallow. This does not change the fact that no 
>     matter which state it enters, it will come back the moment an 
>     interrupt is posted.

No, the timeout value doesn't decide how 'deep' the power state enters.
Basically, the same power consumption with any timeout.

I summarized the comparison of mwait and mwaitx

                MWAIT                           MWAITX
opcode          0f 01 c9           |            0f 01 fb
ECX[0]                  value of RFLAGS.IF seen by instruction
ECX[1]          unused/#GP if set  |            enable timer if set
ECX[31:2]                     unused/#GP if set
EAX                             unused
EBX[31:0]       unused             |            max wait time (loops)


                MONITOR                         MONITORX
opcode          0f 01 c8           |            0f 01 fa
EAX                     (logical) address to monitor
ECX                     #GP if not zero

Thanks,
Rui
--
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