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: <7a95b837-e347-0ad3-3a2c-f347f12d6625@intel.com>
Date:   Thu, 7 Apr 2022 14:16:53 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     "Limonciello, Mario" <Mario.Limonciello@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        "Karny, Wyes" <Wyes.Karny@....com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Carroll, Lewis" <Lewis.Carroll@....com>,
        "Shenoy, Gautham Ranjal" <gautham.shenoy@....com>,
        "Narayan, Ananth" <Ananth.Narayan@....com>,
        "Rao, Bharata Bhasker" <bharata@....com>,
        "len.brown@...el.com" <len.brown@...el.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "hpa@...or.com" <hpa@...or.com>,
        "chang.seok.bae@...el.com" <chang.seok.bae@...el.com>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "metze@...ba.org" <metze@...ba.org>,
        "zhengqi.arch@...edance.com" <zhengqi.arch@...edance.com>,
        "mark.rutland@....com" <mark.rutland@....com>
Subject: Re: [PATCH] x86: Prefer MWAIT over HALT on AMD processors

On 4/6/22 07:23, Limonciello, Mario wrote:
> To confirm the availability of the MSR for a particular CPU, you can look
> at the PPR for a family 19h CPU.  For example here is family 19h model 01h:
> https://www.amd.com/en/support/tech-docs/processor-programming-reference-ppr-for-amd-family-19h-model-01h-revision-b1?msclkid=f5047d01b5b211ec8d619d1385260e2d

I don't want to give you too hard of a time on this.  But, that's not
architecture, that's just telling folks what the implementation is on
*one* CPU model.  Don't get me wrong: these model-specific docs are
great, and I wish Intel published something like that.

But, the code as written depends on behavior for *all* of family 0x19:

>         case 0x17: fallthrough;
>         case 0x19: init_amd_zn(c); break;

So, while the docs for "family 19h model 01h" are *consistent* with this
code, there's also nothing preventing the docs for "family 19h model
02h" from breaking this new MWAIT code.

Now, AMD is full of smart folks that aren't going out of their way to
try and break existing software.  But, actual documentation of the
*architecture* is really preferable to what we have now.  It helps
establish a shared hardware/software contract that keeps both sides honest.

What's missing is something that says:

	All AMD family 0x17 and 0x19 that enumerate support for MWAIT
	also support this "early MWAIT" implementation

That represents a promise from AMD that this can't break in the future.
 It both gives us something unambiguous to write code with *and*
something to help nudge our hardware and microcode colleagues if they
start to do something funny in the future.

Just having that in the changelog would be fine, and a genuine
improvement over what we have now.  Having it one of the
model-independent architecture manuals would be even better.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ