Re: [PATCH v2 1/6] KVM: SVM: Use maxphyaddr in emulator RAX check for VMRUN/VMLOAD/VMSAVE
From: Jim Mattson
Date: Fri Mar 06 2026 - 18:45:47 EST
On Fri, Mar 6, 2026 at 3:20 PM Yosry Ahmed <yosry@xxxxxxxxxx> wrote:
>
> > > Right, but I am trying to have the #GP check for VMLOAD/VMSAVE behave
> > > consistently with vls=1, whether it's done by the hardware or the
> > > emulator.
> >
> > Consistency should not be an issue, since VLS cannot be enabled when
> > the MAXPHYADDRs differ. VLS doesn't work in that scenario.
>
> Why? It's only broken if VMLOAD/VMSAVE is executed with a GPA that
> exceeds the guest's MAXPHYADDR, but not the host's, right? So only
> broken if the guest is misbehaving.
"Misbehaving" is a tad pejorative. Faulting behavior is part of the
architectural specification. A less biased assessment is that VLS is
partially correct when the MAXPHYADDRs don't match.
People thought it was a big deal when FDIV produced incorrect results
one out of 10 billion times.
> Taking a step back, I am not disagreeing that VLS should not be used
> with different MAXPHYADDRs, I am just saying it might be.
That would be wrong.