KVM: arm64: Clean up CONFIG_KVM vs CONFIG_HAVE_KVM
cover KVM: arm64: Clean up CONFIG_KVM vs CONFIG_HAVE_KVM
Fix an oddity where arm64 can end up with KVM=y and HAVE_KVM=n. This doesn't cause problems today as no generic code that supports arm64 uses HAVE_KVM, but that may not always be the case, e.g. I stumbled across this when exploring hiding perf's guest callbacks behind HAVE_KVM=y.
Sean Christopherson (2):
KVM: arm64: Unconditionally include generic KVM's Kconfig
KVM: arm64: Depend on HAVE_KVM => OF instead of directly on OF
arch/arm64/Kconfig | 1 + arch/arm64/kvm/Kconfig | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.33.0.464.g1972c5931b-goog
PATCH 1/2 KVM: arm64: Unconditionally include generic KVM's Kconfig
Unconditionally "source" the generic KVM Kconfig instead of wrapping it with KVM=y. A future patch will select HAVE_KVM so that referencing HAVE_KVM in common kernel code doesn't break, and because KVM=y and HAVE_KVM=n is weird. Source the generic KVM Kconfig unconditionally so that HAVE_KVM and KVM don't end up with a circular dependency.
Note, all but one of generic KVM's "configs" are of the HAVE_XYZ nature, and the one outlier correctly takes a dependency on CONFIG_KVM, i.e. the generic Kconfig is intended to be included unconditionally.
No functional change intended.
--- arch/arm64/kvm/Kconfig | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
arch/arm64/kvm/Kconfig +1 -6
@@ -4,6 +4,7 @@ # source "virt/lib/Kconfig" +source "virt/kvm/Kconfig" menuconfig VIRTUALIZATION bool "Virtualization"
@@ -42,10 +43,4 @@ menuconfig KVM If unsure, say N. -if KVM - -source "virt/kvm/Kconfig" - -endif # KVM - endif # VIRTUALIZATION
Signature · 1 line
2.33.0.464.g1972c5931b-goog
PATCH 2/2 KVM: arm64: Depend on HAVE_KVM => OF instead of directly on OF
In reply to Sean ChristophersonSelect HAVE_KVM if the KVM dependency is met (OF / Open Firmware), and make KVM depend on HAVE_KVM instead of directly on OF. This fixes the oddity where arm64 configs can end up with KVM=y and HAVE_KVM=n, and will hopefully prevent breakage if there are future users of HAVE_KVM.
Note, arm64 unconditionally selects OF, and has always done so (see commit 8c2c3df31e3b ("arm64: Build infrastructure"). Keep the somewhat pointless HAVE_KVM dependency on OF to document that KVM requires Open Firmware support.
No functional change intended.
--- arch/arm64/Kconfig | 1 + arch/arm64/kvm/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm64/Kconfig +1 -0
@@ -187,6 +187,7 @@ config ARM64 select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IRQ_TIME_ACCOUNTING + select HAVE_KVM if OF select HAVE_NMI select HAVE_PATA_PLATFORM select HAVE_PERF_EVENTS
arch/arm64/kvm/Kconfig +1 -1
@@ -20,7 +20,7 @@ if VIRTUALIZATION menuconfig KVM bool "Kernel-based Virtual Machine (KVM) support" - depends on OF + depends on HAVE_KVM select MMU_NOTIFIER select PREEMPT_NOTIFIERS select HAVE_KVM_CPU_RELAX_INTERCEPT
Signature · 1 line
2.33.0.464.g1972c5931b-goog
Re: [PATCH 2/2] KVM: arm64: Depend on HAVE_KVM => OF instead of directly on OF
Quoted 23 lines · Sean Christopherson
Select
HAVE_KVMif the KVM dependency is met (OF / Open Firmware), and make KVM depend onHAVE_KVMinstead of directly on OF. This fixes the oddity where arm64 configs can end up with KVM=y and HAVE_KVM=n, and will hopefully prevent breakage if there are future users ofHAVE_KVM.Note, arm64 unconditionally selects OF, and has always done so (see commit
8c2c3df31e3b("arm64: Build infrastructure"). Keep the somewhat pointlessHAVE_KVMdependency on OF to document that KVM requires Open Firmware support.No functional change intended.
Signed-off-by Sean Christopherson <[email protected]>--- arch/arm64/Kconfig | 1 + arch/arm64/kvm/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)arch/arm64/Kconfig +0
-0
arch/arm64/Kconfig config ARM64 · line 190
Quoted 4 lines
arch/arm64/Kconfig +1
-0@@ -187,6 +187,7 @@ config ARM64 select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IRQ_TIME_ACCOUNTING + select HAVE_KVM if OF
Honestly, I'd just drop the 'if OF' here. We select it unconditionally a few lines below and so I think it's more confusing to have the check.
With that:
Will
Re: [PATCH 2/2] KVM: arm64: Depend on HAVE_KVM => OF instead of directly on OF
Quoted 19 lines · Will Deacon
Quoted 18 lines · Sean Christopherson
Select
HAVE_KVMif the KVM dependency is met (OF / Open Firmware), and make KVM depend onHAVE_KVMinstead of directly on OF. This fixes the oddity where arm64 configs can end up with KVM=y and HAVE_KVM=n, and will hopefully prevent breakage if there are future users ofHAVE_KVM.Note, arm64 unconditionally selects OF, and has always done so (see commit
8c2c3df31e3b("arm64: Build infrastructure"). Keep the somewhat pointlessHAVE_KVMdependency on OF to document that KVM requires Open Firmware support.No functional change intended.
Signed-off-by Sean Christopherson <[email protected]>--- arch/arm64/Kconfig | 1 + arch/arm64/kvm/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Quoted 12 lines
arch/arm64/Kconfig config ARM64 · line 190
Quoted 9 lines
arch/arm64/Kconfig +1
-0@@ -187,6 +187,7 @@ config ARM64 select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IRQ_TIME_ACCOUNTING + select HAVE_KVM if OFHonestly, I'd just drop the 'if OF' here. We select it unconditionally a few lines below and so I think it's more confusing to have the check.
Work for me. I all but flipped a coin when deciding whether or not to keep the OF dependency.
Thanks!
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 10 lines · Sean Christopherson
Fix an oddity where arm64 can end up with KVM=y and HAVE_KVM=n. This doesn't cause problems today as no generic code that supports arm64 uses
HAVE_KVM, but that may not always be the case, e.g. I stumbled across this when exploring hiding perf's guest callbacks behind HAVE_KVM=y.Sean Christopherson (2):
KVM: arm64: Unconditionally include generic KVM'sKconfig
KVM: arm64: Depend onHAVE_KVM=> OF instead of directly on OF[...]
Applied to next, thanks!
[1/2] KVM: arm64: Unconditionally include generic KVM's Kconfig
commit: c8f1e96734069c788b10545f4fd82bcbb6b55dfa
[2/2] KVM: arm64: Depend on HAVE_KVM => OF instead of directly on OF
commit: e26bb75aa2f17fc079e6a24dff653b098e1f5d37Cheers,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.