Re: [PATCH v7 02/23] KVM: Make device name configurable
From: Steffen Eiden
Date: Tue Sep 15 2026 - 11:40:18 EST
On Thu, Sep 03, 2026 at 01:58:17PM -0700, Sean Christopherson wrote:
> On Thu, Sep 03, 2026, Paolo Bonzini wrote:
> > On Thu, Sep 3, 2026 at 5:54 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
> > > > I don't want KVM to be the. one that does things differently *once more*.
> > >
> > > Too late :-D
> > >
> > > arch/arm64/kvm/hyp/nvhe/Makefile:ccflags-y := -D__KVM_NVHE_HYPERVISOR__ -D__DISABLE_EXPORTS -D__DISABLE_TRACE_MMIO__
> > > arch/arm64/kvm/hyp/vhe/Makefile:ccflags-y := -D__KVM_VHE_HYPERVISOR__
> >
> > Sure, VHE/nVHE is fair game because the nVHE case is in the same boat
> > as vDSO, arch/*/boot, and so on.
> >
> > Looking at a grep for (cflags|CFLAGS).*\-D most are -DDEBUG,
> > -DDISABLE_BRANCH_PROFILING, -DDEFAULT_SYMBOL_NAMESPACE, etc. and in
> > most cases they seem like a bad idea. Don't do it for KVM please;
> > requiring -D for all architectures and for random pieces of config,
> > when you can put it in asm/kvm_host.h, is just as bad if not worse.
>
> Boo, it's never fun when a parent shows up and takes away your toys :-D
:)
I will then create a new patch:
I will move config options to asm/kvm_host.h
It makes more sense to me as well to do this in the header.
Shean identified:
KVM_MMU_LOCKLESS_AGING
KVM_GENERIC_PRE_FAULT_MEMORY
HAVE_KVM_MSI
HAVE_KVM_READONLY_MEM
HAVE_KVM_NO_POLL
HAVE_KVM_INVALID_WAKEUPS
I will check the Kconfig files if I find more.
Similary to Kconfig I want to implement them as opt-in.
While I am at it I would streamline the naming and remove the HAVE_
prefix.
<arch>/include/asm/kvm_host.h
#define KVM_GENERIC_PRE_FAULT_MEMORY
#define KVM_INVALID_WAKEUPS
#define KVM_MMU_LOCKLESS_AGING
#define KVM_MSI
#define KVM_NO_POLL
#define KVM_READONLY_MEM
(similar to the MMIO patch)
Any objections for doing this in one patch?
The patch changes the Kconfigs, asm/kvm_host.h and removes the
CONFIG_ prefixes of the configs in the code.
I would handle MMIO in a different patch as this is the only config that
also modifies the Makefile but I am defenitle not aggainst merging it
into the new conversion patch.
If there are no objections I will use the Makefilevariable approach for
KVM_DEV_NAME and KVM_DEV_MINOR. It feels wrong for me to define those in
a header. But defenitely, the devname and minor should be defined at
compile time.
Steffen