target/arm: Mark registers which call pmu_op_start() as ARM_CP_IO
commit7f4fbfb5dc08fe3fb6829bde8e4072d6cb214931
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 23 Sep 2022 12:34:10 +0000 (23 13:34 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 29 Sep 2022 16:31:52 +0000 (29 17:31 +0100)
tree7153d12d5d8a688863fb9be60e3be3c63afe3c1d
parentc8de6ec63d766ca1998c5af468483ce912fdc0c2
target/arm: Mark registers which call pmu_op_start() as ARM_CP_IO

In commit 01765386a888 we made some system register write functions
call pmu_op_start()/pmu_op_finish(). This means that they now touch
timers, so for icount to work these registers must have the ARM_CP_IO
flag set.

This fixes a bug where when icount is enabled a guest that touches
MDCR_EL3, MDCR_EL2, PMCNTENSET_EL0 or PMCNTENCLR_EL0 would cause
QEMU to print an error message and exit, for example:

[    2.495971] TCP: Hash tables configured (established 1024 bind 1024)
[    2.496213] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    2.496386] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    2.496917] NET: Registered protocol family 1
qemu-system-aarch64: Bad icount read

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220923123412.1214041-2-peter.maydell@linaro.org
target/arm/helper.c