[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aB54c5ajYkGZ1sPi@liuwe-devbox-ubuntu-v2.tail21d00.ts.net>
Date: Fri, 9 May 2025 21:49:39 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Juergen Gross <jgross@...e.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
linux-hyperv@...r.kernel.org, kvm@...r.kernel.org, xin@...or.com,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH 3/6] x86/msr: minimize usage of native_*() msr access
functions
On Tue, May 06, 2025 at 11:20:12AM +0200, Juergen Gross wrote:
> In order to prepare for some MSR access function reorg work, switch
> most users of native_{read|write}_msr[_safe]() to the more generic
> rdmsr*()/wrmsr*() variants.
>
> For now this will have some intermediate performance impact with
> paravirtualization configured when running on bare metal, but this
> is a prereq change for the planned direct inlining of the rdmsr/wrmsr
> instructions with this configuration.
>
> The main reason for this switch is the planned move of the MSR trace
> function invocation from the native_*() functions to the generic
> rdmsr*()/wrmsr*() variants. Without this switch the users of the
> native_*() functions would lose the related tracing entries.
>
> Note that the Xen related MSR access functions will not be switched,
> as these will be handled after the move of the trace hooks.
>
> Signed-off-by: Juergen Gross <jgross@...e.com>
> ---
> arch/x86/hyperv/ivm.c | 2 +-
Acked-by: Wei Liu <wei.liu@...nel.org>
>
> diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c
> index 09a165a3c41e..fe177a6be581 100644
> --- a/arch/x86/hyperv/ivm.c
> +++ b/arch/x86/hyperv/ivm.c
> @@ -319,7 +319,7 @@ int hv_snp_boot_ap(u32 cpu, unsigned long start_ip)
> asm volatile("movl %%ds, %%eax;" : "=a" (vmsa->ds.selector));
> hv_populate_vmcb_seg(vmsa->ds, vmsa->gdtr.base);
>
> - vmsa->efer = native_read_msr(MSR_EFER);
> + rdmsrq(MSR_EFER, vmsa->efer);
>
Powered by blists - more mailing lists