Re: [PATCH v3 00/15] KVM: x86: Exit handling for Hyper-V hcalls, register intercept

From: David Woodhouse

Date: Wed Dec 02 2026 - 07:09:34 EST


On Mon, 2026-11-30 at 15:00 -0500, Zack Rusin wrote:
> On Mon, Nov 30, 2026 at 1:07 PM David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
> >
> > On Mon, 2026-11-30 at 12:19 -0500, Zack Rusin wrote:
> > >
> > > My unposted v4 drops the exception fields and any non-zero ret leaves
> > > the instruction alone.  I think with your numbering, that would give 1
> > > and 2 a different meaning for VMware.
> > >
> > > Could VMware take just 0 (complete if the linear RIP still matches)
> > > and 3 (resume as userspace left it)?  KVM_RUN could fail with -EINVAL
> > > for anything else, leaving 1 and 2 available for #GP(0) and #UD.
> >
> > Any reason *not* to allow #GP(0) and #UD? I'd have been OK with not
> > supporting those at all, and only having COMPLETE/RESUME. But the MSR
> > handling already has the #GP(0) option. Now I'm just trying to be a
> > little more consistent.
>
> No technical reason :) Our hypercalls can raise both #GP(0) and #UD,
> and userspace can already queue either fault through vCPU events.
>
> I suggested taking 0 and 3 and failing the rest with -EINVAL so the
> VMware series stays independent of the 2nd patch. That leaves 1 and 2
> free to add once patch 2 is in. If Sean is happy with the numbering, I
> can take all four in v4 of my VMware series.

Feel free to lift patch 2 of my series, which just adds the KVM_INSN_x
definitions without actually using them yet. Or just make the 0123
values work the same as if by coincidence, and we can make it look
intentional later.

There's no rush for my series; I'm just trying to line up the parts of
VSM support which can be done independently before any of the Planes
stuff lands.

And all I *really* need for VSM is the Hyper-V and control reg
intercepts, with a way for them and the existing MSR intercept to
support the 'RESUME' action when the exit is being reflected to another
VTL.

Harmonising the return codes is just trying to make the world a better
place, but I'd like to see Sean and/or Paolo opine on that.

Attachment: smime.p7s
Description: S/MIME cryptographic signature