linux/arch
Sean Christopherson 9d2180ac56 KVM: x86: Move kvm_caps and kvm_host_values to asm/kvm_host.h
Relocate the kvm_caps and kvm_host_values struct definitions and their
associated global variable declarations to asm/kvm_host.h to allow for a
variety of cleanups in x86.h and mmu.h, and to establish a (hopefully)
maintainable rule that asm/kvm_host.h's role is to define common
structures (and declare any associated globals), and anything needed by
arch-neutral KVM.

While it would be lovely to trim kvm_host.h down to the point where it
*only* holds things needed by arch-neutral and/or non-KVM code, multiple
attempts to do just that have failed miserably.  Trying to "hide" code
from arch-neutral KVM is too restrictive (and ultimately pointless), and
KVM x86 itself also needs a place to define common structures and their
globals, e.g. to avoid inconsistent header include chains and/or misplaced
helpers.

E.g. as pointed out by Kai, it's weird that x86.h, which is a kitchen sink
of sorts, includes regs.h, but not mmu.h.  Literally the only reason that
x86.h doesn't include mmu.h is that mmu.h references kvm_host, which is
currently defined in x86.h.  As a result of odd include ordering, the
very clearly MMU-specific helper mmu_is_nested() lives in x86.h, not mmu.h

"Fix" the kvm_host dependency so that x86.h can be the "central" include
everyone expects it to be, and set KVM x86 on the path to having somewhat
sensible "rules" for what goes where:

  - asm/kvm_host.h holds "common" structure definitions and associated key
    global variables, and things that are referenced by arch-neutral KVM.
  - <thing>.{c,h} holds relevant declarations and definitions.
  - x86.{c,h} is the kitchen sink for everything else.

Cc: Kai Huang <kai.huang@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Yosry Ahmed <yosry@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20260613000329.732085-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-24 08:13:08 -04:00
..
alpha ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
arc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
arm ARM fixes for 7.1 2026-06-14 15:37:39 +01:00
arm64 KVM/arm64 updates for 7.2 2026-06-12 10:51:42 +02:00
csky ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
hexagon ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
loongarch LoongArch: KVM: Add missing slots_lock for device register/unregister 2026-06-11 20:46:44 +08:00
m68k ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
microblaze ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
mips TTY/Serial driver fixes for 7.1-rc6 2026-05-30 08:34:03 -07:00
nios2 NIOS2: updates for v7.2 2026-05-23 09:21:08 -07:00
openrisc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
parisc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
powerpc Including fixes from Bluetooth, wireless and netfilter. 2026-05-21 14:39:12 -07:00
riscv KVM/riscv changes for 7.2 2026-06-15 15:38:14 +02:00
s390 KVM: s390: Fix S390_USER_OPEREXEC and more gmap fixes 2026-06-24 13:41:41 +02:00
sh ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
sparc ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
um ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
x86 KVM: x86: Move kvm_caps and kvm_host_values to asm/kvm_host.h 2026-06-24 08:13:08 -04:00
xtensa ring-buffer: Flush and stop persistent ring buffer on panic 2026-05-21 08:20:58 -04:00
.gitignore
Kconfig parisc architecture fixes and updates for kernel v7.1-rc1: 2026-04-18 11:37:36 -07:00