Skip to content

Commit 9b80b96

Browse files
author
Marc Zyngier
committed
KVM: arm64: pmu: Guard PMU emulation definitions with CONFIG_KVM
Most of the internal definitions for PMU emulation are guarded with CONFIG_HW_PERF_EVENTS. However, this isn't enough, and leads to these definitions leaking if CONFIG_KVM isn't enabled. This leads to some compilation breakage in this exact configuration. Fix it by falling back to the dummy stubs if either perf or KVM isn't selected. Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent b1f778a commit 9b80b96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/kvm/arm_pmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#define ARMV8_PMU_CYCLE_IDX (ARMV8_PMU_MAX_COUNTERS - 1)
1414

15-
#ifdef CONFIG_HW_PERF_EVENTS
15+
#if IS_ENABLED(CONFIG_HW_PERF_EVENTS) && IS_ENABLED(CONFIG_KVM)
1616

1717
struct kvm_pmc {
1818
u8 idx; /* index into the pmu->pmc array */

0 commit comments

Comments
 (0)