// SPDX-License-Identifier: GPL-2.0-only/* * ARMv8 PMUv3 Performance Events handling code. * * Copyright (C) 2012 ARM Limited * Author: Will Deacon <will.deacon@arm.com> * * This code is based heavily on the ARMv7 perf event code. */#include<asm/irq_regs.h>#include<asm/perf_event.h>#include<asm/virt.h>#include<clocksource/arm_arch_timer.h>#include<linux/acpi.h>#include<linux/bitfield.h>#include<linux/clocksource.h>#include<linux/of.h>#include<linux/perf/arm_pmu.h>#include<linux/perf/arm_pmuv3.h>#include<linux/platform_device.h>#include<linux/sched_clock.h>#include<linux/smp.h>#include<linux/nmi.h>/* ARMv8 Cortex-A53 specific event types. */#define ARMV8_A53_PERFCTR_PREF_LINEFILL 0xC2/* ARMv8 Cavium ThunderX specific event types. */#define ARMV8_THUNDER_PERFCTR_L1D_CACHE_MISS_ST 0xE9#define ARMV8_THUNDER_PERFCTR_L1D_CACHE_PREF_ACCESS 0xEA#define ARMV8_THUNDER_PERFCTR_L1D_CACHE_PREF_MISS 0xEB#define ARMV8_THUNDER_PERFCTR_L1I_CACHE_PREF_ACCESS 0xEC#define ARMV8_THUNDER_PERFCTR_L1I_CACHE_PREF_MISS 0xED/* * ARMv8 Architectural defined events, not all of these may * be supported on any given implementation. Unsupported events will * be disabled at run-time based on the PMCEID registers. */staticconstunsignedarmv8_pmuv3_perf_map[PERF_COUNT_HW_MAX]={PERF_MAP_ALL_UNSUPPORTED,[PERF_COUNT_HW_CPU_CYCLES