Re: [PATCH 01/15] hyperv-tlfs: Change shared HV_REGISTER_* defines to HV_MSR_*

From: Wei Liu
Date: Wed Aug 02 2023 - 21:25:48 EST


On Thu, Jul 27, 2023 at 12:54:36PM -0700, Nuno Das Neves wrote:
> In x86 hyperv-tlfs, HV_REGISTER_ prefix is used to indicate MSRs
> accessed via rdmsrl/wrmsrl. But in ARM64, HV_REGISTER_ instead indicates
> VP registers accessed via get/set vp registers hypercall.
>
> This is due to HV_REGISTER_* names being used by hv_set/get_register,
> with the arch-specific version delegating to the appropriate mechanism.
>
> The problem is, using prefix HV_REGISTER_ for MSRs will conflict with
> VP registers when they are introduced for x86 in future.
>
> This patch solves the issue by:
>
> 1. Defining all the x86 MSRs with a consistent prefix: HV_X64_MSR_.
> This is so HV_REGISTER_ can be reserved for VP registers.
>
> 2. Change the non-arch-specific alias used by hv_set/get_register to
> HV_MSR_. This is also happens to be the same name HyperV uses for this
> purpose.
>
> Signed-off-by: Nuno Das Neves <nunodasneves@xxxxxxxxxxxxxxxxxxx>

Assuming the prior (private?) discussion with Michael led to this patch:

Acked-by: Wei Liu <wei.liu@xxxxxxxxxx>