From: Dave Hansen <dave.hansen@intel.com>
To: Peter Zijlstra <peterz@infradead.org>, Wyes Karny <wyes.karny@amd.com>
Cc: linux-kernel@vger.kernel.org, Lewis.Carroll@amd.com,
Mario.Limonciello@amd.com, gautham.shenoy@amd.com,
Ananth.Narayan@amd.com, bharata@amd.com, len.brown@intel.com,
x86@kernel.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
chang.seok.bae@intel.com, keescook@chromium.org, metze@samba.org,
zhengqi.arch@bytedance.com, mark.rutland@arm.com
Subject: Re: [PATCH] x86: Prefer MWAIT over HALT on AMD processors
Date: Tue, 5 Apr 2022 08:10:05 -0700 [thread overview]
Message-ID: <7cdc2103-c6d4-e1b6-9804-6739112eee4d@intel.com> (raw)
In-Reply-To: <YkxNFyXqC12nXyfM@hirez.programming.kicks-ass.net>
On 4/5/22 07:07, Peter Zijlstra wrote:
> On Tue, Apr 05, 2022 at 06:30:21PM +0530, Wyes Karny wrote:
>> +static inline bool early_mwait_supported(const struct cpuinfo_x86 *c)
>> +{
>> + if (c->x86_vendor == X86_VENDOR_INTEL)
>> + return true;
>> +
>> + if (c->x86_vendor == X86_VENDOR_AMD && cpu_has(c, X86_FEATURE_ZEN))
> What about Hygon? For some reason you guys don't co-ordinate and we end
> up getting endless 'make-same' patches, sometimes separated by years :/
Believe it or not Hygon seems to work OK with this because:
> static void init_hygon(struct cpuinfo_x86 *c)
> {
...
> set_cpu_cap(c, X86_FEATURE_ZEN);
I do worry a bit though that using X86_FEATURE_ZEN is going to bite us
long-term. It currently claims to be set for "family 0x17 or above":
> #define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 or above (Zen) */
But then it goes and gets used in side-channel defense:
> if (!static_cpu_has(X86_FEATURE_ZEN)) {
> msr |= ssbd_tif_to_amd_ls_cfg(tifn);
> wrmsrl(MSR_AMD64_LS_CFG, msr);
> return;
> }
This seem _bit_ at odds with the commit message (and the AMD SSBD
whitepaper):
> Add the necessary synchronization logic for AMD family 17H.
So, is X86_FEATURE_ZEN for family==0x17, or family>=0x17?
next prev parent reply other threads:[~2022-04-05 20:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 13:00 [PATCH] x86: Prefer MWAIT over HALT on AMD processors Wyes Karny
2022-04-05 14:05 ` Borislav Petkov
2022-04-05 20:26 ` Carroll, Lewis
2022-04-05 20:38 ` Borislav Petkov
2022-04-05 21:49 ` Carroll, Lewis
2022-04-06 9:30 ` Borislav Petkov
2022-04-06 6:14 ` Wyes Karny
2022-04-06 9:25 ` Borislav Petkov
2022-04-05 14:07 ` Peter Zijlstra
2022-04-05 15:10 ` Dave Hansen [this message]
2022-04-05 15:34 ` Limonciello, Mario
2022-04-05 15:47 ` Dave Hansen
2022-04-05 20:40 ` Limonciello, Mario
2022-04-06 1:44 ` Thomas Gleixner
2022-04-06 14:23 ` Limonciello, Mario
2022-04-07 21:16 ` Dave Hansen
2022-04-08 1:24 ` Limonciello, Mario
2022-04-14 21:06 ` Limonciello, Mario
2022-04-07 2:19 ` Wen Pu
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=7cdc2103-c6d4-e1b6-9804-6739112eee4d@intel.com \
--to=dave.hansen@intel.com \
--cc=Ananth.Narayan@amd.com \
--cc=Lewis.Carroll@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=bharata@amd.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=gautham.shenoy@amd.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=metze@samba.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=wyes.karny@amd.com \
--cc=x86@kernel.org \
--cc=zhengqi.arch@bytedance.com \
/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;
as well as URLs for NNTP newsgroup(s).