target/ppc: PMU: update counters on PMCs r/w
commit308b9fad2a301f3473e920f981d49e2ff0829029
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 17 Dec 2021 16:57:18 +0000 (17 17:57 +0100)
committerCédric Le Goater <clg@kaod.org>
Fri, 17 Dec 2021 16:57:18 +0000 (17 17:57 +0100)
tree31a1efd3afb8af06592c3bdcfb3ffae982a777a1
parentc2eff582a32f4251515e041f4919d3fbe4a0048e
target/ppc: PMU: update counters on PMCs r/w

Calling pmu_update_cycles() on every PMC read/write operation ensures
that the values being fetched are up to date with the current PMU state.

In theory we can get away by just trapping PMCs reads, but we're going
to trap PMC writes to deal with counter overflow logic later on.  Let's
put the required wiring for that and make our lives a bit easier in the
next patches.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20211201151734.654994-4-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
target/ppc/cpu_init.c
target/ppc/helper.h
target/ppc/power8-pmu-regs.c.inc
target/ppc/power8-pmu.c
target/ppc/spr_tcg.h