Re: [tip: perf/core] perf: Use EXPORT_SYMBOL_FOR_KVM() for the mediated APIs
From: Peter Zijlstra
Date: Fri Dec 19 2025 - 02:52:47 EST
On Thu, Dec 18, 2025 at 10:40:51AM -0800, Sean Christopherson wrote:
> Include the arch-defined asm/kvm_types.h if and only if the kernel is
> being compiled for an architecture that supports KVM so that kvm_types.h
> can be included in generic code without having to guard _those_ includes,
> and without having to add "generic-y += kvm_types.h" for all architectures
> that don't support KVM.
Something jogged my brain and the below seems to work for the few
architectures I've tried. Let me update the patch and see if the build
robot still finds fail.
---
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
index 295c94a3ccc1..9aff61e7b8f2 100644
--- a/include/asm-generic/Kbuild
+++ b/include/asm-generic/Kbuild
@@ -32,6 +32,7 @@ mandatory-y += irq_work.h
mandatory-y += kdebug.h
mandatory-y += kmap_size.h
mandatory-y += kprobes.h
+mandatory-y += kvm_types.h
mandatory-y += linkage.h
mandatory-y += local.h
mandatory-y += local64.h