Re: [PATCH v4 04/30] KVM: x86: Move the bulk of register specific code from x86.c to regs.c

From: Binbin Wu

Date: Mon Jun 15 2026 - 01:28:52 EST


On 6/13/2026 8:03 AM, Sean Christopherson wrote:
> Introduce regs.c, and move the vast majority of register specific code out
> of x86.c and into regs.c. Deliberately leave behind MSR code, as KVM's MSR
> support is complex enough to warrant its own compilation unit, and doesn't
> have much in common with the other register code.
>
> Note, "struct kvm_sregs" has fields for EFER and MSR_IA32_APICBASE, and so
> the {G,S}ET_REGS flows technically contain a tiny amount of MSR code.
^
Should be {G,S}ET_SREGS

> MSR_IA32_APICBASE is already managed by lapic.c, and so doesn't require a
> "placement decision". As for EFER, leave all other EFER handling in x86.c
> (later to be moved to msrs.c). The primary interface to EFER, set_efer(),
> is very much MSR specific, even though EFER is arguably more of a Control
> Register than an MSR.
>
> No functional change intended.
>
> Reviewed-by: Kai Huang <kai.huang@xxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>