Download raw body.
vmm: Inject #UD for VMs running SVM
On Fri, Nov 21, 2025 at 03:45:06PM +0100, hshoexer wrote: > Hi, > > right now, vmm(4) only injects #UD correctly, when running on > intel/VMX. Running on amd/SVM we hit the default case. > > #UD does not provide an error code, so bit 11 of EVENTINJ must be > clear. > > ok? > > -------------------------------------------------------------- > diff --git a/sys/arch/amd64/amd64/vmm_machdep.c b/sys/arch/amd64/amd64/vmm_machdep.c > index 9e63a0415bb..a85e1908c72 100644 > --- a/sys/arch/amd64/amd64/vmm_machdep.c > +++ b/sys/arch/amd64/amd64/vmm_machdep.c > @@ -6739,6 +6739,10 @@ vcpu_run_svm(struct vcpu *vcpu, struct vm_run_params *vrp) > */ > vmcb->v_eventinj |= (4ULL << 8); > break; > + case VMM_EX_UD: > + /* Hardware exception, no error code. */ > + vmcb->v_eventinj |= (3ULL << 8); > + break; > case VMM_EX_AC: > vcpu->vc_inject.vie_errorcode = 0; > /* fallthrough */ > I have a better diff for this that I made at the hackathon. I'll send it tomorrow when I'm back on that machine. There are/were errors also in the #UD handling on VMX.
vmm: Inject #UD for VMs running SVM