Re: [PATCH v8 10/20] KVM: x86: Support EGPR accessing and tracking for emulator
From: Jim Mattson
Date: Thu Nov 05 2026 - 19:55:23 EST
On Wed, Sep 30, 2026 at 2:37 PM Chang S. Bae <chang.seok.bae@xxxxxxxxx> wrote:
>
> Extend the emulator context and GPR accessors to handle EGPRs before
> adding support for REX2-prefixed instructions. Like VCPU cache, the
> emulator can uniformly cache and track all GPRs.
>
> Also replace `1 << reg` with `BIT(reg)` in reg_read()/reg_write(). The
> former performs a signed 32-bit shift, which becomes undefined for R31.
> BIT() instead shifts an unsigned value that is suitable for all indices.
>
> Tested-by: Zhao Liu <zhao1.liu@xxxxxxxxx>
> Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>