[PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions

Dave Hansen posted 8 patches 1 month, 1 week ago
msr.h      |  124 +++++++++++++++++++++++++++++++------------------------------
paravirt.h |   44 ---------------------
2 files changed, 65 insertions(+), 103 deletions(-)
[PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions
Posted by Dave Hansen 1 month, 1 week ago
Changes from v1:
 - Remove "raw_" names. Just use "paravirt_" in the generic code.

I'm thinking I'll just apply this in the coming days if nobody
screams too loudly.

--

This is old cruft, but it appears that having two copies of these
MSR functions is enabling warnings to creep in[1].

I know there's also been some work to pare down the XXL code, but
it's obviously not merged yet and this is a good baby step.

Create helpers that both paravirt and native can use in common code
and remove the paravirt implementations of the helpers. This reduces
the amount of logic that is duplicated in the paravirt code.

The wonky thing about this solution is that it has the common code
always make literal "paravirt_" calls, even when paravirt is not in
use for MSRs. In that case, the calls just go directly to the
"native_" functions via #defines.

Conceptually:
 -   native: The bare-metal implementation. Might not be usable under
	     paravirt XXL.
 - paravirt: Call the native version directly if paravirt is compiled
 	     out. Call into paravirt ops when available, which might
	     ultimately call a native implementation.

1. https://lore.kernel.org/all/20260319152210.210854-1-aldocontelk@gmail.com/

 msr.h      |  124 +++++++++++++++++++++++++++++++------------------------------
 paravirt.h |   44 ---------------------
 2 files changed, 65 insertions(+), 103 deletions(-)
Re: [PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions
Posted by Jürgen Groß 1 month, 1 week ago
On 29.04.26 20:45, Dave Hansen wrote:
> Changes from v1:
>   - Remove "raw_" names. Just use "paravirt_" in the generic code.
> 
> I'm thinking I'll just apply this in the coming days if nobody
> screams too loudly.
> 
> --
> 
> This is old cruft, but it appears that having two copies of these
> MSR functions is enabling warnings to creep in[1].
> 
> I know there's also been some work to pare down the XXL code, but
> it's obviously not merged yet and this is a good baby step.
> 
> Create helpers that both paravirt and native can use in common code
> and remove the paravirt implementations of the helpers. This reduces
> the amount of logic that is duplicated in the paravirt code.
> 
> The wonky thing about this solution is that it has the common code
> always make literal "paravirt_" calls, even when paravirt is not in
> use for MSRs. In that case, the calls just go directly to the
> "native_" functions via #defines.
> 
> Conceptually:
>   -   native: The bare-metal implementation. Might not be usable under
> 	     paravirt XXL.
>   - paravirt: Call the native version directly if paravirt is compiled
>   	     out. Call into paravirt ops when available, which might
> 	     ultimately call a native implementation.
> 
> 1. https://lore.kernel.org/all/20260319152210.210854-1-aldocontelk@gmail.com/
> 
>   msr.h      |  124 +++++++++++++++++++++++++++++++------------------------------
>   paravirt.h |   44 ---------------------
>   2 files changed, 65 insertions(+), 103 deletions(-)

Apart from the comment for patch 8:

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
Re: [PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions
Posted by Juergen Gross 2 weeks, 6 days ago
On 30.04.26 09:21, Jürgen Groß wrote:
> On 29.04.26 20:45, Dave Hansen wrote:
>> Changes from v1:
>>   - Remove "raw_" names. Just use "paravirt_" in the generic code.
>>
>> I'm thinking I'll just apply this in the coming days if nobody
>> screams too loudly.
>>
>> -- 
>>
>> This is old cruft, but it appears that having two copies of these
>> MSR functions is enabling warnings to creep in[1].
>>
>> I know there's also been some work to pare down the XXL code, but
>> it's obviously not merged yet and this is a good baby step.
>>
>> Create helpers that both paravirt and native can use in common code
>> and remove the paravirt implementations of the helpers. This reduces
>> the amount of logic that is duplicated in the paravirt code.
>>
>> The wonky thing about this solution is that it has the common code
>> always make literal "paravirt_" calls, even when paravirt is not in
>> use for MSRs. In that case, the calls just go directly to the
>> "native_" functions via #defines.
>>
>> Conceptually:
>>   -   native: The bare-metal implementation. Might not be usable under
>>          paravirt XXL.
>>   - paravirt: Call the native version directly if paravirt is compiled
>>            out. Call into paravirt ops when available, which might
>>          ultimately call a native implementation.
>>
>> 1. https://lore.kernel.org/all/20260319152210.210854-1-aldocontelk@gmail.com/
>>
>>   msr.h      |  124 +++++++++++++++++++++++++++++++------------------------------
>>   paravirt.h |   44 ---------------------
>>   2 files changed, 65 insertions(+), 103 deletions(-)
> 
> Apart from the comment for patch 8:
> 
> Reviewed-by: Juergen Gross <jgross@suse.com>

Is this going to be taken in near future?

Just asking to know whether I should base the MSR patches I'm working on
on current master or on these patches.


Juergen