[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
- To: "Juergen Gross" <jgross@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, "linux-edac@xxxxxxxxxxxxxxx" <linux-edac@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, linux-coco@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, linux-ide@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-fbdev@xxxxxxxxxxxxxxx, linux-crypto@xxxxxxxxxxxxxxx, "open list:GPIO SUBSYSTEM" <linux-gpio@xxxxxxxxxxxxxxx>, linux-hyperv@xxxxxxxxxxxxxxx, linux-hwmon@xxxxxxxxxxxxxxx, linux-perf-users@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, platform-driver-x86@xxxxxxxxxxxxxxx
- From: "Arnd Bergmann" <arnd@xxxxxxxx>
- Date: Mon, 29 Jun 2026 08:52:18 +0200
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm1 header.d=arndb.de header.i="@arndb.de" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=fm1 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
- Cc: "Rafael J . Wysocki" <rafael@xxxxxxxxxx>, "Daniel Lezcano" <daniel.lezcano@xxxxxxxxxx>, "Zhang Rui" <rui.zhang@xxxxxxxxx>, "lukasz.luba@xxxxxxx" <lukasz.luba@xxxxxxx>, "Jason Baron" <jbaron@xxxxxxxxxx>, "Borislav Petkov" <bp@xxxxxxxxx>, "Tony Luck" <tony.luck@xxxxxxxxx>, "Yazen Ghannam" <yazen.ghannam@xxxxxxx>, "Len Brown" <lenb@xxxxxxxxxx>, "Pavel Machek" <pavel@xxxxxxxxxx>, "Thomas Gleixner" <tglx@xxxxxxxxxx>, "Ingo Molnar" <mingo@xxxxxxxxxx>, "Dave Hansen" <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, "Sean Christopherson" <seanjc@xxxxxxxxxx>, "Paolo Bonzini" <pbonzini@xxxxxxxxxx>, "Kirill A. Shutemov" <kas@xxxxxxxxxx>, "Rick Edgecombe" <rick.p.edgecombe@xxxxxxxxx>, "Pu Wen" <puwen@xxxxxxxx>, "Bjorn Helgaas" <bhelgaas@xxxxxxxxxx>, "Ajay Kaher" <ajay.kaher@xxxxxxxxxxxx>, "Alexey Makhalov" <alexey.makhalov@xxxxxxxxxxxx>, "Broadcom internal kernel review list" <bcm-kernel-feedback-list@xxxxxxxxxxxx>, "Viresh Kumar" <viresh.kumar@xxxxxxxxxx>, "Reinette Chatre" <reinette.chatre@xxxxxxxxx>, "Dave Martin" <Dave.Martin@xxxxxxx>, "James Morse" <james.morse@xxxxxxx>, "Babu Moger" <babu.moger@xxxxxxx>, "Tony W Wang-oc" <TonyWWang-oc@xxxxxxxxxxx>, "Damien Le Moal" <dlemoal@xxxxxxxxxx>, "Niklas Cassel" <cassel@xxxxxxxxxx>, "Dave Airlie" <airlied@xxxxxxxxxx>, "Helge Deller" <deller@xxxxxx>, linux-geode@xxxxxxxxxxxxxxxxxxx, "Olivia Mackall" <olivia@xxxxxxxxxxx>, "Herbert Xu" <herbert@xxxxxxxxxxxxxxxxxxx>, "Linus Walleij" <linusw@xxxxxxxxxx>, "Bartosz Golaszewski" <brgl@xxxxxxxxxx>, "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>, "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>, "Haiyang Zhang" <haiyangz@xxxxxxxxxxxxx>, "Wei Liu" <wei.liu@xxxxxxxxxx>, "Dexuan Cui" <decui@xxxxxxxxxxxxx>, "Long Li" <longli@xxxxxxxxxxxxx>, "Guenter Roeck" <linux@xxxxxxxxxxxx>, "Peter Zijlstra" <peterz@xxxxxxxxxxxxx>, "Arnaldo Carvalho de Melo" <acme@xxxxxxxxxx>, "Namhyung Kim" <namhyung@xxxxxxxxxx>, "Mark Rutland" <mark.rutland@xxxxxxx>, "Alexander Shishkin" <alexander.shishkin@xxxxxxxxxxxxxxx>, "Jiri Olsa" <jolsa@xxxxxxxxxx>, "Ian Rogers" <irogers@xxxxxxxxxx>, "Adrian Hunter" <adrian.hunter@xxxxxxxxx>, "James Clark" <james.clark@xxxxxxxxxx>, "Josh Poimboeuf" <jpoimboe@xxxxxxxxxx>, "Pawan Gupta" <pawan.kumar.gupta@xxxxxxxxxxxxxxx>, "Vitaly Kuznetsov" <vkuznets@xxxxxxxxxx>, "Andy Lutomirski" <luto@xxxxxxxxxx>, "Boris Ostrovsky" <boris.ostrovsky@xxxxxxxxxx>, "Huang Rui" <ray.huang@xxxxxxx>, "Mario Limonciello" <mario.limonciello@xxxxxxx>, "Perry Yuan" <perry.yuan@xxxxxxx>, "K Prateek Nayak" <kprateek.nayak@xxxxxxx>, "srinivas.pandruvada@xxxxxxxxxxxxxxx" <srinivas.pandruvada@xxxxxxxxxxxxxxx>, "Artem Bityutskiy" <artem.bityutskiy@xxxxxxxxxxxxxxx>, "Artem Bityutskiy" <dedekind1@xxxxxxxxx>, "Miquel Raynal" <miquel.raynal@xxxxxxxxxxx>, "Richard Weinberger" <richard@xxxxxx>, "Vignesh Raghavendra" <vigneshr@xxxxxx>, "Ashok Raj" <ashok.raj.linux@xxxxxxxxx>, "Hans de Goede" <hansg@xxxxxxxxxx>, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>, "Rajneesh Bhardwaj" <irenic.rajneesh@xxxxxxxxx>, "David E Box" <david.e.box@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 29 Jun 2026 06:52:54 +0000
- Feedback-id: i56a14606:Fastmail
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|