From: "Arnd Bergmann" <arnd@arndb.de>
To: "Juergen Gross" <jgross@suse.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
x86@kernel.org, linux-acpi@vger.kernel.org, kvm@vger.kernel.org,
linux-coco@lists.linux.dev, linux-pci@vger.kernel.org,
virtualization@lists.linux.dev, linux-ide@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-crypto@vger.kernel.org,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
platform-driver-x86@vger.kernel.org
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
"Daniel Lezcano" <daniel.lezcano@kernel.org>,
"Zhang Rui" <rui.zhang@intel.com>,
"lukasz.luba@arm.com" <lukasz.luba@arm.com>,
"Jason Baron" <jbaron@akamai.com>,
"Borislav Petkov" <bp@alien8.de>,
"Tony Luck" <tony.luck@intel.com>,
"Yazen Ghannam" <yazen.ghannam@amd.com>,
"Len Brown" <lenb@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
"Thomas Gleixner" <tglx@kernel.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"Sean Christopherson" <seanjc@google.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kirill A. Shutemov" <kas@kernel.org>,
"Rick Edgecombe" <rick.p.edgecombe@intel.com>,
"Pu Wen" <puwen@hygon.cn>, "Bjorn Helgaas" <bhelgaas@google.com>,
"Ajay Kaher" <ajay.kaher@broadcom.com>,
"Alexey Makhalov" <alexey.makhalov@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
"Reinette Chatre" <reinette.chatre@intel.com>,
"Dave Martin" <Dave.Martin@arm.com>,
"James Morse" <james.morse@arm.com>,
"Babu Moger" <babu.moger@amd.com>,
"Tony W Wang-oc" <TonyWWang-oc@zhaoxin.com>,
"Damien Le Moal" <dlemoal@kernel.org>,
"Niklas Cassel" <cassel@kernel.org>,
"Dave Airlie" <airlied@redhat.com>,
"Helge Deller" <deller@gmx.de>,
linux-geode@lists.infradead.org,
"Olivia Mackall" <olivia@selenic.com>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"Linus Walleij" <linusw@kernel.org>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"K. Y. Srinivasan" <kys@microsoft.com>,
"Haiyang Zhang" <haiyangz@microsoft.com>,
"Wei Liu" <wei.liu@kernel.org>,
"Dexuan Cui" <decui@microsoft.com>,
"Long Li" <longli@microsoft.com>,
"Guenter Roeck" <linux@roeck-us.net>,
"Peter Zijlstra" <peterz@infradead.org>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Jiri Olsa" <jolsa@kernel.org>, "Ian Rogers" <irogers@google.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"James Clark" <james.clark@linaro.org>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Pawan Gupta" <pawan.kumar.gupta@linux.intel.com>,
"Vitaly Kuznetsov" <vkuznets@redhat.com>,
"Andy Lutomirski" <luto@kernel.org>,
"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
"Huang Rui" <ray.huang@amd.com>,
"Mario Limonciello" <mario.limonciello@amd.com>,
"Perry Yuan" <perry.yuan@amd.com>,
"K Prateek Nayak" <kprateek.nayak@amd.com>,
"srinivas.pandruvada@linux.intel.com"
<srinivas.pandruvada@linux.intel.com>,
"Artem Bityutskiy" <artem.bityutskiy@linux.intel.com>,
"Artem Bityutskiy" <dedekind1@gmail.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Ashok Raj" <ashok.raj.linux@gmail.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Rajneesh Bhardwaj" <irenic.rajneesh@gmail.com>,
"David E Box" <david.e.box@intel.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
Date: Mon, 29 Jun 2026 08:52:18 +0200 [thread overview]
Message-ID: <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com> (raw)
In-Reply-To: <20260629060526.3638272-1-jgross@suse.com>
On Mon, Jun 29, 2026, at 08:04, Juergen Gross wrote:
> For accessing the MSR registers on the local CPU, there are 2 types of
> interfaces: the "modern" 64-bit ones (rdmsrq() etc.) and the 32-bit
> ones (rdmsr() etc.) which are using the upper and lower 32-bit halves
> of the 64-bit wide MSR register values.
>
> The 32-bit interfaces are not optimal for 3 reasons:
>
> - They are based on primitives using 64-bit sized values anyway.
>
> - Modern x86 CPUs have added support for MSR access instructions using
> an immediate value instead of a register for addressing the MSR,
> while the value is in a 64-bit register.
>
> - rdmsr() is a macro storing the upper and lower 32-bit halves in
> variables specified as macro parameters. This is obscuring variable
> assignment through a macro. Additionally rdmsrq() is mimicking this
> pattern by being a macro, too, with the target variable specified as
> a parameter as well.
>
> For those reasons drop the 32-bit interfaces for accessing the x86 MSR
> registers completely and only use the 64-bit variants.
Hi Jürgen,
I assume this is fine, but since you don't mention it explicitly here,
please clarify what this means for 32-bit CPUs without the rdmsrq
instruction. Those will continue using the same instructions as before
and just change the calling conventions, right?
> Note that most patches of this series are independent from each other.
> Only the patches removing a specific interface (patches 7, 15, 26 and
> 30) and the last two patches of the series depend on all previous
> patches.
It looks like you are touching most files twice or more here, to
first convert from rdmsr to rdmsrq and then to change the
two-argument rdmsrq() macro to a single-argument inline. If you
introduce the inline version of rdmsrq() first, you should be
able to skip the second step (patch 31) as they could be able
to coexist.
Arnd
next prev parent reply other threads:[~2026-06-29 6:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 6:04 [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces Juergen Gross
2026-06-29 6:05 ` [PATCH 09/32] KVM/x86: Stop using " Juergen Gross
2026-06-29 6:05 ` [PATCH 31/32] treewide: convert rdmsrq() from a macro to an inline function Juergen Gross
2026-06-29 6:52 ` Arnd Bergmann [this message]
2026-06-29 7:01 ` [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces Jürgen Groß
2026-06-29 8:06 ` Arnd Bergmann
2026-06-29 8:15 ` Jürgen Groß
2026-06-29 8:38 ` Arnd Bergmann
2026-06-30 20:06 ` H. Peter Anvin
2026-06-29 11:19 ` Ingo Molnar
2026-06-30 18:59 ` Sean Christopherson
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=d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Dave.Martin@arm.com \
--cc=TonyWWang-oc@zhaoxin.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=airlied@redhat.com \
--cc=ajay.kaher@broadcom.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.makhalov@broadcom.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=ashok.raj.linux@gmail.com \
--cc=babu.moger@amd.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=brgl@kernel.org \
--cc=cassel@kernel.org \
--cc=daniel.lezcano@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=david.e.box@intel.com \
--cc=decui@microsoft.com \
--cc=dedekind1@gmail.com \
--cc=deller@gmx.de \
--cc=dlemoal@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=hansg@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=irenic.rajneesh@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=james.morse@arm.com \
--cc=jbaron@akamai.com \
--cc=jgross@suse.com \
--cc=jolsa@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=kas@kernel.org \
--cc=kprateek.nayak@amd.com \
--cc=kvm@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=lenb@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-geode@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=longli@microsoft.com \
--cc=lukasz.luba@arm.com \
--cc=luto@kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=miquel.raynal@bootlin.com \
--cc=namhyung@kernel.org \
--cc=olivia@selenic.com \
--cc=pavel@kernel.org \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=perry.yuan@amd.com \
--cc=peterz@infradead.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=puwen@hygon.cn \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--cc=reinette.chatre@intel.com \
--cc=richard@nod.at \
--cc=rick.p.edgecombe@intel.com \
--cc=rui.zhang@intel.com \
--cc=seanjc@google.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=vigneshr@ti.com \
--cc=viresh.kumar@linaro.org \
--cc=virtualization@lists.linux.dev \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=yazen.ghannam@amd.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