Re: [PATCH v7 03/23] KVM: Allow KVM implementations to switch off MMIO independent of Kconfig

From: Steffen Eiden

Date: Wed Sep 02 2026 - 04:26:21 EST


On Tue, Sep 01, 2026 at 05:38:53PM -0700, Sean Christopherson wrote:
> On Mon, Aug 31, 2026, Steffen Eiden wrote:
> > Only defining KVM_MMIO is not flexible enough for multi-KVM systems
> > where one KVM implements MMIO but others do not. Solve this by
> > additionally testing for the non-existence of KVM_NO_MMIO before
> > including MMIO code to KVM.
>
> Ewwwww. IIUC, s390 ends up with two KVM modules, i.e. there really are two different
> KVMs being built. Rather than have a KVM_MMIO and NO_KVM_MMIO, I vote very
> strongly to drop CONFIG_KVM_MMIO entirely and replace it with __KVM_HAVE_ARCH_MMIO,
> a la __KVM_HAVE_ARCH_VM_FREE and others. Tracking two separate macros is going
> to be annoying to maintain, and will definitely be confusing for non-s390 people.

You understand correclty we compile kvm twice into different modules.

I already did this approach (with a differnt name) and dropped the
config in (v1,v2,v3, and) v4 of this Series[1] and Marc voted against this :)

I have no strong opinion on this and do whatever the both of you come up
with :)

>
> It'll mean linking in an emtpy coalesced_mmio.o on s390 when building without arm64
> support, but I'm guessing that won't be at all common for s390 builds.

This should be no problem, I assume.

Steffen

[1] https://lore.kernel.org/all/87a4s37scc.wl-maz@xxxxxxxxxx/