[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1412c7a5-8961-4949-b09e-7b9d080ce9bf@zytor.com>
Date: Tue, 30 Sep 2025 12:19:33 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-coco@...ts.linux.dev, kvm@...r.kernel.org,
linux-hyperv@...r.kernel.org, virtualization@...ts.linux.dev,
llvm@...ts.linux.dev
Cc: xin@...or.com, "Kirill A. Shutemov" <kas@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
xen-devel@...ts.xenproject.org, Ajay Kaher <ajay.kaher@...adcom.com>,
Alexey Makhalov <alexey.makhalov@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Nathan Chancellor
<nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH v2 00/12] x86/msr: Inline rdmsr/wrmsr instructions
On 2025-09-30 00:03, Juergen Gross wrote:
> When building a kernel with CONFIG_PARAVIRT_XXL the paravirt
> infrastructure will always use functions for reading or writing MSRs,
> even when running on bare metal.
>
> Switch to inline RDMSR/WRMSR instructions in this case, reducing the
> paravirt overhead.
>
> In order to make this less intrusive, some further reorganization of
> the MSR access helpers is done in the first 5 patches.
>
> The next 5 patches are converting the non-paravirt case to use direct
> inlining of the MSR access instructions, including the WRMSRNS
> instruction and the immediate variants of RDMSR and WRMSR if possible.
>
> Patch 11 removes the PV hooks for MSR accesses and implements the
> Xen PV cases via calls depending on X86_FEATURE_XENPV, which results
> in runtime patching those calls away for the non-XenPV case.
>
> Patch 12 is a final little cleanup patch.
>
> This series has been tested to work with Xen PV and on bare metal.
>
> This series is inspired by Xin Li, who used a similar approach, but
> (in my opinion) with some flaws. Originally I thought it should be
> possible to use the paravirt infrastructure, but this turned out to be
> rather complicated, especially for the Xen PV case in the *_safe()
> variants of the MSR access functions.
>
Looks good to me.
(I'm not at all surprised that paravirt_ops didn't do the job. Both I and Xin
had come to the same conclusion.)
Reviewed-by: H. Peter Anvin (Intel) <hpa@...or.com>
Powered by blists - more mailing lists