On Fri, Mar 20, 2026 at 12:03:30PM -0700, Dave Hansen wrote:
> 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 other thing I really like about this is that it puts the
> raw=>{native,paravirt} switch in one compact place in the code.
> 
> Conceptually:
>  -   native: The bare-metal implementation. Might not be usable under
>            paravirt XXL.
>  -      raw: The lowest-level function that is always usable. Might
>            be native or paravirt under the hood.

I went through the patchset twice and I kinda get what you're trying to do but
the "raw" thing is confusing as hell.

To me "raw" means, the lowest level of the functionality - something like
__<function_name> with the two underscores. Or three, depending on the
indirection levels.

And those do *only* *raw* instructions - no more indirections.

But then how can "raw" be the lowest level and then still have something else
underneath - native_ and paravirt_?

I *think* this is only a naming issue and with "raw_" you probably wanna say
"native_or_paravirt_" depending on the ifdeffery... but shorter...

If so, I wouldn't call it "raw". I'd say

xx_read_msr()
xx_write_msr()

to denote that the "xx" resolves to either of the two types. But a better
name. I can't think of a good one now but I know that "raw" isn't it...

Hmmm.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Reply via email to