[PATCH v8 08/29] KVM: Move architecture capability Kconfigs to header defines
Steffen Eiden
seiden at linux.ibm.com
Mon Sep 21 00:09:41 PDT 2026
On Fri, Sep 18, 2026 at 03:30:45PM +0200, Steffen Eiden wrote:
> Historically, KVM feature opt-ins and callbacks (e.g. read-only memory,
> MSI routing, generic pre-fault memory, lockless aging, halt-polling
> controls, and vcpu run PID changes) were configured globally via Kconfig
> symbols (CONFIG_HAVE_KVM_* and CONFIG_KVM_*).
>
> With s390 hosting multiple independent KVM implementations within the
> same kernel build (native s390 KVM and arm64 on s390), global Kconfig
> selections force both implementations to inherit options that only apply
> to one of them. For instance, selecting KVM_GENERIC_PRE_FAULT_MEMORY for
> native s390 would force arm64 on s390 to provide unused dummy stubs.
>
> Replace these global Kconfig options with architecture-specific opt-in
> defines in <asm/kvm_host.h> and standardize their naming by dropping the
> HAVE_ prefix:
> - KVM_GENERIC_PRE_FAULT_MEMORY
> - KVM_INVALID_WAKEUPS
> - KVM_MSI (formerly HAVE_KVM_MSI)
> - KVM_NO_POLL (formerly HAVE_KVM_NO_POLL)
> - KVM_READONLY_MEM (formerly HAVE_KVM_READONLY_MEM)
> - KVM_VCPU_RUN_PID_CHANGE (formerly HAVE_KVM_VCPU_RUN_PID_CHANGE)
>
> This allows each architecture and guest implementation to configure its
> supported capabilities independently in its kvm_host header and eliminates
> unnecessary fallback stubs across different KVM targets.
>
> Signed-off-by: Steffen Eiden <seiden at linux.ibm.com>
> ---
> arch/arm64/include/asm/kvm_host.h | 3 +++
> arch/arm64/kvm/Kconfig | 3 ---
> arch/loongarch/include/asm/kvm_host.h | 2 ++
> arch/loongarch/kvm/Kconfig | 2 --
> arch/mips/include/asm/kvm_host.h | 1 +
> arch/mips/kvm/Kconfig | 1 -
> arch/powerpc/include/asm/kvm_host.h | 3 +++
> arch/powerpc/kvm/Kconfig | 1 -
> arch/riscv/include/asm/kvm_host.h | 2 ++
> arch/riscv/kvm/Kconfig | 2 --
> arch/s390/include/asm/kvm_host_s390.h | 4 ++++
> arch/s390/kvm/Kconfig | 3 ---
> arch/x86/include/asm/kvm_host.h | 4 ++++
> arch/x86/kvm/Kconfig | 4 ----
> include/linux/kvm_host.h | 20 ++++++++++++--------
> virt/kvm/Kconfig | 20 +-------------------
> virt/kvm/kvm_main.c | 8 ++++----
> 17 files changed, 36 insertions(+), 47 deletions(-)
>
...
> diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig
> index c3c0ee253fc7..008b110ebdb7 100644
> --- a/virt/kvm/Kconfig
> +++ b/virt/kvm/Kconfig
> @@ -9,7 +9,7 @@ config KVM_COMMON
> select PREEMPT_NOTIFIERS
>
> config HAVE_KVM_PFNCACHE
> - bool
> + booCONFIG_ltt
Sorry, that must have sneaked in last minute.
Obviously, this is a mistake.
More information about the linux-arm-kernel
mailing list