]> xenbits.xensource.com Git - qemu-xen.git/commit
target/ppc: introduce PMUEventType and PMU overflow timers
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 17 Dec 2021 16:57:18 +0000 (17:57 +0100)
committerCédric Le Goater <clg@kaod.org>
Fri, 17 Dec 2021 16:57:18 +0000 (17:57 +0100)
commit8f2e9d400320d75bb54d693282672cc407d8a128
tree912c79a2a1f2df12115e0ffde0ef5f80ec5232ea
parent29c4a3363bf287bb9a7b0342b1bc2dba3661c96c
target/ppc: introduce PMUEventType and PMU overflow timers

This patch starts an IBM Power8+ compatible PMU implementation by adding
the representation of PMU events that we are going to sample,
PMUEventType. This enum represents a Perf event that is being sampled by
a specific counter 'sprn'. Events that aren't available (i.e. no event
was set in MMCR1) will be of type 'PMU_EVENT_INVALID'. Events that are
inactive due to frozen counter bits state are of type
'PMU_EVENT_INACTIVE'. Other types added in this patch are
PMU_EVENT_CYCLES and PMU_EVENT_INSTRUCTIONS.  More types will be added
later on.

Let's also add the required PMU cycle overflow timers. They will be used
to trigger cycle overflows when cycle events are being sampled. This
timer will call cpu_ppc_pmu_timer_cb(), which in turn calls
fire_PMC_interrupt().  Both functions are stubs that will be implemented
later on when EBB support is added.

Two new helper files are created to host this new logic.
cpu_ppc_pmu_init() will init all overflow timers during CPU init time.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20211201151734.654994-2-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/ppc/spapr_cpu_core.c
target/ppc/cpu.h
target/ppc/cpu_init.c
target/ppc/meson.build
target/ppc/power8-pmu.c [new file with mode: 0644]
target/ppc/power8-pmu.h [new file with mode: 0644]