Thread (43 messages) 43 messages, 5 authors, 2021-11-11

Re: [PATCH v3 15/16] KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c / pmu.c

From: Sean Christopherson <seanjc@google.com>
Date: 2021-11-09 23:16:26
Also in: kvm, kvmarm, linux-perf-users, linux-riscv, lkml, xen-devel

On Mon, Oct 11, 2021, Marc Zyngier wrote:
On Wed, 22 Sep 2021 01:05:32 +0100,
Sean Christopherson [off-list ref] wrote:
quoted
diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h
index 864b9997efb2..42270676498d 100644
--- a/include/kvm/arm_pmu.h
+++ b/include/kvm/arm_pmu.h
@@ -14,6 +14,7 @@
 #define ARMV8_PMU_MAX_COUNTER_PAIRS	((ARMV8_PMU_MAX_COUNTERS + 1) >> 1)
 
 DECLARE_STATIC_KEY_FALSE(kvm_arm_pmu_available);
+void kvm_pmu_init(void);
 
 static __always_inline bool kvm_arm_support_pmu_v3(void)
 {
Note that this patch is now conflicting with e840f42a4992 ("KVM:
arm64: Fix PMU probe ordering"), which was merged in -rc4. Moving the
static key definition to arch/arm64/kvm/pmu-emul.c and getting rid of
kvm_pmu_init() altogether should be enough to resolve it.
Defining kvm_arm_pmu_available in pmu-emul.c doesn't work as-is because pmu-emul.c
depends on CONFIG_HW_PERF_EVENTS=y.  Since pmu-emul.c is the only path that enables
the key, my plan is to add a prep match to bury kvm_arm_pmu_available behind the
existing #ifdef CONFIG_HW_PERF_EVENTS in arm_pmu.h and add a stub
for kvm_arm_support_pmu_v3().  The only ugly part is that the KVM_NVHE_ALIAS() also
gains an #ifdef, but that doesn't seem too bad.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help