perf: arm_pmuv3: Include asm/arm_pmuv3.h from linux/perf/arm_pmuv3.h
authorRob Herring (Arm) <robh@kernel.org>
Wed, 26 Jun 2024 22:32:29 +0000 (16:32 -0600)
committerWill Deacon <will@kernel.org>
Wed, 3 Jul 2024 13:07:14 +0000 (14:07 +0100)
The arm64 asm/arm_pmuv3.h depends on defines from
linux/perf/arm_pmuv3.h. Rather than depend on include order, follow the
usual pattern of "linux" headers including "asm" headers of the same
name.

With this change, the include of linux/kvm_host.h is problematic due to
circular includes:

In file included from ../arch/arm64/include/asm/arm_pmuv3.h:9,
                 from ../include/linux/perf/arm_pmuv3.h:312,
                 from ../include/kvm/arm_pmu.h:11,
                 from ../arch/arm64/include/asm/kvm_host.h:38,
                 from ../arch/arm64/mm/init.c:41:
../include/linux/kvm_host.h:383:30: error: field 'arch' has incomplete type

Switching to asm/kvm_host.h solves the issue.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240626-arm-pmu-3-9-icntr-v2-5-c9784b4f4065@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/arm_pmuv3.h
arch/arm64/kvm/pmu-emul.c
drivers/perf/arm_pmuv3.c
include/linux/perf/arm_pmuv3.h

index c27404fa4418ad36682e33a92d073375bb8442b9..a4697a0b6835844e0eed3626b1383f14ea7c524c 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __ASM_PMUV3_H
 #define __ASM_PMUV3_H
 
-#include <linux/kvm_host.h>
+#include <asm/kvm_host.h>
 
 #include <asm/cpufeature.h>
 #include <asm/sysreg.h>
index a35ce10e0a9f3efe554cbf4b1d11fc2300ed54e4..d1a476b08f542773514c5c110f1d26216751db13 100644 (file)
@@ -14,7 +14,6 @@
 #include <asm/kvm_emulate.h>
 #include <kvm/arm_pmu.h>
 #include <kvm/arm_vgic.h>
-#include <asm/arm_pmuv3.h>
 
 #define PERF_ATTR_CFG1_COUNTER_64BIT   BIT(0)
 
index d6248493b5c6a0222aff7cb787ad9f526a51dfb2..cf0430c266a65149af69b1d9d5eef50bf5099072 100644 (file)
@@ -25,8 +25,6 @@
 #include <linux/smp.h>
 #include <linux/nmi.h>
 
-#include <asm/arm_pmuv3.h>
-
 /* ARMv8 Cortex-A53 specific event types. */
 #define ARMV8_A53_PERFCTR_PREF_LINEFILL                                0xC2
 
index 46377e134d67cba65d7f2aa59dc4127af71381de..7867db04ec988a34cc45a990dd2c66b7e67fc3e2 100644 (file)
                }                                               \
        } while (0)
 
+#include <asm/arm_pmuv3.h>
+
 #endif