Re: [PATCH v5 1/9] KVM: VMX: Use on-stack copy of @flags in __vmx_vcpu_run()
From: Brendan Jackman
Date: Fri Nov 14 2025 - 07:36:04 EST
On Thu Nov 13, 2025 at 11:37 PM UTC, Sean Christopherson wrote:
> When testing for VMLAUNCH vs. VMRESUME, use the copy of @flags from the
> stack instead of first moving it to EBX, and then propagating
> VMX_RUN_VMRESUME to RFLAGS.CF (because RBX is clobbered with the guest
> value prior to the conditional branch to VMLAUNCH). Stashing information
> in RFLAGS is gross, especially with the writer and reader being bifurcated
> by yet more gnarly assembly code.
>
> Opportunistically drop the SHIFT macros as they existed purely to allow
> the VM-Enter flow to use Bit Test.
>
> Suggested-by: Borislav Petkov <bp@xxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Brendan Jackman <jackmanb@xxxxxxxxxx>