Re: [PATCH 06/11] KVM: x86: Move kvm_<reg>_{read,write}() definitions to x86.h

From: Yosry Ahmed

Date: Tue Apr 21 2026 - 19:34:35 EST


On Thu, Apr 09, 2026 at 04:56:17PM -0700, Sean Christopherson wrote:
> Move the direct GPR accessors to x86.h so that they can use
> is_64_bit_mode().
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> arch/x86/kvm/kvm_cache_regs.h | 34 ----------------------------------
> arch/x86/kvm/x86.h | 34 ++++++++++++++++++++++++++++++++++

That's a shame, register accessors semantically fit in kvm_cache_regs.h,
but taking a step back.. is it even worth having kvm_cache_regs.h
anymore?

At some point I needed to move guest mode helpers out of there too (as
they should be):

https://lore.kernel.org/kvm/20260326031150.3774017-3-yosry@xxxxxxxxxx/

With this patch and that one, we'd have <200 lines left. Is there a
reason why it can't just be merged with x86.h? I don't see any of the
headers included by x86.h including kvm_cache_regs.h.