@@ -157,8 +157,7 @@ endif
# ARM
OBJS_ARM_COMMON := arm/fdt.o arm/gic.o arm/gicv2m.o arm/ioport.o \
- arm/kvm.o arm/kvm-cpu.o arm/pci.o arm/timer.o \
- arm/pmu.o
+ arm/kvm.o arm/kvm-cpu.o arm/pci.o arm/timer.o
HDRS_ARM_COMMON := arm/include
ifeq ($(ARCH), arm)
DEFINES += -DCONFIG_ARM
@@ -180,6 +179,7 @@ ifeq ($(ARCH), arm64)
OBJS += arm/aarch64/arm-cpu.o
OBJS += arm/aarch64/kvm-cpu.o
OBJS += arm/aarch64/kvm.o
+ OBJS += arm/aarch64/pmu.o
ARCH_INCLUDE := $(HDRS_ARM_COMMON)
ARCH_INCLUDE += -Iarm/aarch64/include
@@ -5,7 +5,8 @@
#include "arm-common/gic.h"
#include "arm-common/timer.h"
-#include "arm-common/pmu.h"
+
+#include "asm/pmu.h"
#include <linux/byteorder.h>
#include <linux/types.h>
similarity index 100%
rename from arm/include/arm-common/pmu.h
rename to arm/aarch64/include/asm/pmu.h
similarity index 93%
rename from arm/pmu.c
rename to arm/aarch64/pmu.c
@@ -4,9 +4,9 @@
#include "kvm/util.h"
#include "arm-common/gic.h"
-#include "arm-common/pmu.h"
-#ifdef CONFIG_ARM64
+#include "asm/pmu.h"
+
static int set_pmu_attr(struct kvm *kvm, int vcpu_idx,
struct kvm_device_attr *attr)
{
@@ -71,6 +71,3 @@ void pmu__generate_fdt_nodes(void *fdt, struct kvm *kvm)
_FDT(fdt_property(fdt, "interrupts", irq_prop, sizeof(irq_prop)));
_FDT(fdt_end_node(fdt));
}
-#else
-void pmu__generate_fdt_nodes(void *fdt, struct kvm *kvm) { }
-#endif
KVM for aarch32 does not exist anymore, PMUv3 is a hardware feature present only on aarch64 CPUs, the command line option to enable the feature for a VCPU is aarch64 specific, the PMU code is called only from an aarch64 function and it compiles to an empty stub when ARCH=arm. There is no reason to have the PMUv3 emulation code in the common code area for arm and arm64, so move it to the arm64 directory, where it can be expanded in the future without fear of breaking aarch32 support. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- Makefile | 4 ++-- arm/aarch64/arm-cpu.c | 3 ++- arm/{include/arm-common => aarch64/include/asm}/pmu.h | 0 arm/{ => aarch64}/pmu.c | 7 ++----- 4 files changed, 6 insertions(+), 8 deletions(-) rename arm/{include/arm-common => aarch64/include/asm}/pmu.h (100%) rename arm/{ => aarch64}/pmu.c (93%)