diff options
author | Marc Zyngier <maz@kernel.org> | 2023-08-23 12:14:48 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-08-23 22:01:03 +0300 |
commit | 9b80b9676be901eb980c48543a19d7026d2f84b8 (patch) | |
tree | 11426b5aabd78b2e24110435a20de615dab1f75b | |
parent | b1f778a223a2a8ad6262e5233cfc3483bcf6e213 (diff) | |
download | linux-9b80b9676be901eb980c48543a19d7026d2f84b8.tar.xz |
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>
-rw-r--r-- | include/kvm/arm_pmu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h index 3a8a70a60794..31029f4f7be8 100644 --- a/include/kvm/arm_pmu.h +++ b/include/kvm/arm_pmu.h @@ -12,7 +12,7 @@ #define ARMV8_PMU_CYCLE_IDX (ARMV8_PMU_MAX_COUNTERS - 1) -#ifdef CONFIG_HW_PERF_EVENTS +#if IS_ENABLED(CONFIG_HW_PERF_EVENTS) && IS_ENABLED(CONFIG_KVM) struct kvm_pmc { u8 idx; /* index into the pmu->pmc array */ |