[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a482b4df-f662-4d5d-8100-ade07afcdc24@zytor.com>
Date: Tue, 22 Apr 2025 02:12:46 -0700
From: Xin Li <xin@...or.com>
To: Jürgen Groß <jgross@...e.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-perf-users@...r.kernel.org, linux-hyperv@...r.kernel.org,
virtualization@...ts.linux.dev, linux-pm@...r.kernel.org,
linux-edac@...r.kernel.org, xen-devel@...ts.xenproject.org,
linux-acpi@...r.kernel.org, linux-hwmon@...r.kernel.org,
netdev@...r.kernel.org, platform-driver-x86@...r.kernel.org
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
acme@...nel.org, andrew.cooper3@...rix.com, peterz@...radead.org,
namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
irogers@...gle.com, adrian.hunter@...el.com, kan.liang@...ux.intel.com,
wei.liu@...nel.org, ajay.kaher@...adcom.com,
bcm-kernel-feedback-list@...adcom.com, tony.luck@...el.com,
pbonzini@...hat.com, vkuznets@...hat.com, seanjc@...gle.com,
luto@...nel.org, boris.ostrovsky@...cle.com, kys@...rosoft.com,
haiyangz@...rosoft.com, decui@...rosoft.com
Subject: Re: [RFC PATCH v2 06/34] x86/msr: Use the alternatives mechanism to
read PMC
On 4/22/2025 1:38 AM, Jürgen Groß wrote:
> On 22.04.25 10:21, Xin Li (Intel) wrote:
>> To eliminate the indirect call overhead introduced by the pv_ops API,
>> use the alternatives mechanism to read PMC:
>
> Which indirect call overhead? The indirect call is patched via the
> alternative mechanism to a direct one.
>
See below.
>>
>> 1) When built with !CONFIG_XEN_PV, X86_FEATURE_XENPV becomes a
>> disabled feature, preventing the Xen PMC read code from being
>> built and ensuring the native code is executed unconditionally.
>
> Without CONFIG_XEN_PV CONFIG_PARAVIRT_XXL is not selected, resulting in
> native code anyway.
Yes, this is kept in this patch, but in a little different way.
>
>>
>> 2) When built with CONFIG_XEN_PV:
>>
>> 2.1) If not running on the Xen hypervisor (!X86_FEATURE_XENPV),
>> the kernel runtime binary is patched to unconditionally
>> jump to the native PMC read code.
>>
>> 2.2) If running on the Xen hypervisor (X86_FEATURE_XENPV), the
>> kernel runtime binary is patched to unconditionally jump
>> to the Xen PMC read code.
>>
>> Consequently, remove the pv_ops PMC read API.
>
> I don't see the value of this patch.
>
> It adds more #ifdef and code lines without any real gain.
>
> In case the x86 maintainers think it is still worth it, I won't object.
I think we want to totally bypass pv_ops in the case 2.1).
Do you mean the indirect call is patched to call native code *directly*
for 2.1? I don't know it, can you please elaborate?
AFAIK, Xen PV has been the sole user of pv_ops for nearly 20 years. This
raises significant doubts about whether pv_ops provides Linux with the
value of being a well-abstracted "CPU" or "Platform". And the x86
maintainers have said that it's a maintenance nightmare.
Thanks!
Xin
Powered by blists - more mailing lists