From: Artem Bityutskiy <dedekind1@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM Mailing List <linux-pm@vger.kernel.org>,
Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH v3 1/2] x86/mwait: Add support for idle via umwait
Date: Fri, 07 Jul 2023 20:13:23 +0300 [thread overview]
Message-ID: <eef335753f73e505eb91307b2a2cd06b32901d24.camel@gmail.com> (raw)
In-Reply-To: <87352a0vu4.ffs@tglx>
On Fri, 2023-06-30 at 00:04 +0200, Thomas Gleixner wrote:
> > +#ifdef CONFIG_X86_64
> > +/*
> > + * Monitor a memory address at 'rcx' using the 'umonitor' instruction.
> > + */
> > +static inline void __umonitor(const void *rcx)
> > +{
> > + /* "umonitor %rcx" */
> > +#ifdef CONFIG_AS_TPAUSE
>
> Are you sure that the instruction check for TPAUSE is sufficient to also
> include UMONITOR on all toolchains which support TPAUSE?
I've verified by building the kernel with gcc/binutils and clang/LLVM.
Builds, boots, umwait works, C0.2 happens with both.
I inspected gcc, binutils, and clang/llvm git logs: support for
'tpause' and 'umwait' arrived in the same commit. Details below.
'tpause' and 'umwait' instructions are very similar, arrived together,
guarded together by CPUID.7's "MWAITPKG" bit. Based on this, I'd generally
expect toolchains to support both or none.
I can add a note about this in the commit message too.
Details on commits in the projects I checked.
1. binutils-gcc git tree:
de89d0a34d5 Enable Intel WAITPKG instructions.
2. gcc git tree:
55f31ed10fd i386-common.c (OPTION_MASK_ISA_WAITPKG_SET, [...]): New defines.
3. llvm-project git tree:
2e02579a76cf [OpenMP] Add use of TPAUSE
It'll take some time to re-test and and partially re-measure power/perf,
so I'll send new version a bit later.
Thanks,
Artem.
next prev parent reply other threads:[~2023-07-07 17:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 18:35 [PATCH v3 0/3] Sapphire Rapids C0.x idle states support Artem Bityutskiy
2023-06-10 18:35 ` [PATCH v3 1/2] x86/mwait: Add support for idle via umwait Artem Bityutskiy
2023-06-29 19:03 ` Rafael J. Wysocki
2023-06-29 22:04 ` Thomas Gleixner
2023-06-29 22:36 ` Thomas Gleixner
2023-06-30 16:54 ` Artem Bityutskiy
2023-07-07 17:13 ` Artem Bityutskiy [this message]
2023-06-10 18:35 ` [PATCH v3 2/2] intel_idle: add C0.2 state for Sapphire Rapids Xeon Artem Bityutskiy
2023-06-29 22:05 ` [PATCH v3 0/3] Sapphire Rapids C0.x idle states support Thomas Gleixner
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=eef335753f73e505eb91307b2a2cd06b32901d24.camel@gmail.com \
--to=dedekind1@gmail.com \
--cc=arjan@linux.intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).