Re: [PATCH v7 3/8] KVM: nSVM: Track valid hardware DecodeAssist bytes

From: Jim Mattson

Date: Fri Sep 18 2026 - 07:13:10 EST


On Fri, Sep 18, 2026 at 1:56 AM Tina Zhang <zhang_wei@xxxxxxxxxxxxxx> wrote:
>
> VMCB02 instruction bytes are valid only for the hardware VM-Exit that
> populated them. Track whether VMCB02 contains instruction bytes for the
> data #PF or #NPF currently being reflected to L1 so that stale bytes are
> not copied to VMCB12.
>
> Invalidate VMCB02's instruction-byte state when preparing VMCB02,
> normally in response to an emulated VMRUN. Mark the bytes as valid only
> when the current VMCB02 exit is a data #PF or #NPF. Opcode exits and
> instruction-fetch faults are excluded by inspecting the exit state.
>
> A subsequent change will use this state when propagating hardware
> DecodeAssist instruction bytes to VMCB12.
>
> Signed-off-by: Tina Zhang <zhang_wei@xxxxxxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>