Re: [PATCH hyperv-next v5 04/16] arch/x86: mshyperv: Trap on access for some synthetic MSRs
From: Wei Liu
Date: Tue Sep 30 2025 - 17:59:29 EST
On Tue, Sep 09, 2025 at 03:11:47AM +0000, Michael Kelley wrote:
> From: Roman Kisel <romank@xxxxxxxxxxxxxxxxxxx> Sent: Wednesday, August 27, 2025 6:06 PM
> >
> > hv_set_non_nested_msr() has special handling for SINT MSRs
> > when a paravisor is present. In addition to updating the MSR on the
> > host, the mirror MSR in the paravisor is updated, including with the
> > proxy bit. But with Confidential VMBus, the proxy bit must not be
> > used, so add a special case to skip it.
> >
> > Signed-off-by: Roman Kisel <romank@xxxxxxxxxxxxxxxxxxx>
> > Reviewed-by: Alok Tiwari <alok.a.tiwari@xxxxxxxxxx>
> > Reviewed-by: Tianyu Lan <tiala@xxxxxxxxxxxxx>
> > ---
[...]
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> > index a619b661275b..5e2c6fd637d2 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -28,6 +28,7 @@
> > #include <asm/apic.h>
> > #include <asm/timer.h>
> > #include <asm/reboot.h>
> > +#include <asm/msr.h>
> > #include <asm/nmi.h>
> > #include <clocksource/hyperv_timer.h>
> > #include <asm/msr.h>
> > @@ -38,6 +39,16 @@
> > bool hv_nested;
> > struct ms_hyperv_info ms_hyperv;
> >
> > +#define HYPERV_SINT_PROXY_ENABLE BIT(20)
> > +#define HYPERV_SINT_PROXY_DISABLE 0
>
> Seems like these definitions belong in hvgdk_mini.h together with
> the definition of "union hv_synic_sint". Since that union already
> defines the "proxy" field, the definitions really should be in terms
> of that field (though I'd have to fiddle with the code to figure out
> if there's a reasonable way to do that).
>
If we use sint.proxy (or sint->proxy) then we don't even need this
definition. I think this is only needed because the code writes u64
directly to the MSR without reinterpreting it as hv_synic_sint.
Wei