Re: [PATCH v3 00/40] KVM: x86: GPR accessors and x86.{c,h} spring cleaning

From: Sean Christopherson

Date: Fri Jun 05 2026 - 14:42:22 EST


On Fri, 29 May 2026 15:21:43 -0700, Sean Christopherson wrote:
> The first half of this series adds proper, explicit "raw" versions of
> kvm_<reg>_{read,write}(), along with "e" versions (for hardcoded 32-bit
> accesses), and converts the existing kvm_<reg>_{read,write}() APIs into
> mode-aware variants.
>
> At the end of that journey, introduce regs.{c,h} to avoid moving _more_ code
> into x86.h, especially since the resulting code split would be super arbitrary.
>
> [...]

Applied the cleanups, and two one-off patches, to kvm-x86 misc. I'll send a v4
for the code reshuffling, targeting 7.3.

[01/40] KVM: SVM: Truncate INVLPGA address in compatibility mode
https://github.com/kvm-x86/linux/commit/42a842f3f6b9
[02/40] KVM: x86/xen: Bug the VM if 32-bit KVM observes a 64-bit mode hypercall
https://github.com/kvm-x86/linux/commit/09912b8ad22f
[03/40] KVM: x86/xen: Don't truncate RAX when handling hypercall from protected guest
https://github.com/kvm-x86/linux/commit/9377016c2f9e
[04/40] KVM: VMX: Read 32-bit GPR values for ENCLS instructions outside of 64-bit mode
https://github.com/kvm-x86/linux/commit/f43caad54cc0
[05/40] KVM: x86: Trace hypercall register *after* truncating values for 32-bit
https://github.com/kvm-x86/linux/commit/16b5d193b212
[06/40] KVM: x86: Rename kvm_cache_regs.h => regs.h
https://github.com/kvm-x86/linux/commit/ece08316ca21
[07/40] KVM: x86: Move inlined GPR, CR, and DR helpers from x86.h to regs.h
https://github.com/kvm-x86/linux/commit/ed8a7b89c504
[08/40] KVM: x86: Add mode-aware versions of kvm_<reg>_{read,write}() helpers
https://github.com/kvm-x86/linux/commit/fc40b1254c32
[09/40] KVM: x86: Drop non-raw kvm_<reg>_write() helpers
https://github.com/kvm-x86/linux/commit/308851c2d6f8
[10/40] KVM: nSVM: Use kvm_rax_read() now that it's mode-aware
https://github.com/kvm-x86/linux/commit/a7e6e09b27ca
[11/40] Revert "KVM: VMX: Read 32-bit GPR values for ENCLS instructions outside of 64-bit mode"
https://github.com/kvm-x86/linux/commit/b6a0fdf2bbf0
[12/40] KVM: x86: Harden is_64_bit_hypercall() against bugs on 32-bit kernels
https://github.com/kvm-x86/linux/commit/879fffc09474
[13/40] KVM: x86: Move update_cr8_intercept() to lapic.c
https://github.com/kvm-x86/linux/commit/c7722e5e1dae
[14/40] KVM: x86: Move async #PF helpers to x86.h (as inlines)
https://github.com/kvm-x86/linux/commit/bc87aec39399

...

[17/40] KVM: x86: Drop defunct vcpu_tsc_khz() declaration
https://github.com/kvm-x86/linux/commit/e688ca78589d

...

[29/40] KVM: x86: Remove defunct kvm_load_segment_descriptor() declaration.
https://github.com/kvm-x86/linux/commit/5fd25aacdf89

--
https://github.com/kvm-x86/linux/tree/next