]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: x86: Move inlined GPR, CR, and DR helpers from x86.h to regs.h
authorSean Christopherson <seanjc@google.com>
Fri, 29 May 2026 22:21:50 +0000 (15:21 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 3 Jun 2026 12:35:19 +0000 (05:35 -0700)
commited8a7b89c504aa24c01014dd4ebde50dbf8ac9d0
tree088377d2c3ac10690ebc92a66a7178775e8c5d9a
parentece08316ca21ac2a3f3cc47a27b25f95adf1cfb2
KVM: x86: Move inlined GPR, CR, and DR helpers from x86.h to regs.h

Move inlined General Purpose Register, Control Register, and Debug
Register helpers from x86.h to the aptly named regs.h, to help trim
down x86.h (and x86.c in the future).

Move *very* select EFER functionality as well, but leave behind the bulk of
EFER handling and all other MSR handling.  There is more than enough MSR
code to carve out msrs.{c,h} in the future.  Give is_long_bit_mode()
special treatment as it's more along the lines of a CR4 bit check, but just
happens to be accessed through an MSR interface.  And more importantly,
because giving regs.h access to is_long_bit_mode() greatly simplifies
dependency chains.

No functional change intended.

Reviewed-by: Yosry Ahmed <yosry@kernel.org>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://patch.msgid.link/20260529222223.870923-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/regs.h
arch/x86/kvm/x86.h