On 25.07.2025 20:01, Alex Richardson wrote:
In the PMUv3, a new AArch32 64-bit (MCRR/MRRC) accessor for the
PMCCNTR was added. In QEMU we forgot to implement this, so only
provide the 32-bit accessor. Since we have a 64-bit PMCCNTR
sysreg for AArch64, adding the 64-bit AArch32 version is easy.
We add the PMCCNTR to the v8_cp_reginfo because PMUv3 was added
in the ARMv8 architecture. This is consistent with how we
handle the existing PMCCNTR support, where we always implement
it for all v7 CPUs. This is arguably something we should
clean up so it is gated on ARM_FEATURE_PMU and/or an ID
register check for the relevant PMU version, but we should
do that as its own tidyup rather than being inconsistent between
this PMCCNTR accessor and the others.
Since the register name is the same as the 32-bit PMCCNTR, we set
ARM_CP_NO_GDB on the 32-bit one to avoid generating an invalid GDB XML.
See
https://developer.arm.com/documentation/ddi0601/2024-06/AArch32-Registers/PMCCNTR--Performance-Monitors-Cycle-Count-Register?lang=en
Change v2->v3:
- Moved ARM_CP_NO_GDB to the 32-bit register if Armv8 is supported
Changes v1->v2:
- Moved to new file
- Updated commit message
- Added ARM_CP_NO_GDB
Signed-off-by: Alex Richardson <alexrichard...@google.com>
---
target/arm/cpregs-pmu.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
Hi!
This patch is marked as to back-port to stable series, with
the commit message tweak by Peter:
Note for potential backporting:
* this code in cpregs-pmu.c will be in helper.c on stable
branches that don't have commit ae2086426d37
The mentioned commit:
commit ae2086426d3784cf66e5b0b7ac823c08e87b4c57
Author: Richard Henderson <richard.hender...@linaro.org>
Date: Mon Jul 7 09:15:47 2025 -0600
target/arm: Split out performance monitor regs to cpregs-pmu.c
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Message-id: 20250707151547.196393-4-richard.hender...@linaro.org
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
The thing is that this commit not only split out parts of helper.c
to cpregs-pmu.c, but it also modified the code quite significantly,
which is not even mentioned in the commit message.
This makes back-porting of the changes more difficult, which is okay, -
for this I'm asking for help (provided this fix is really needed for
10.0.x stable branch).
But this also brings a more general question, or a suggestion. When
splitting stuff into a separate file, *and* modifying it in process,
can't we do it in 2 stages, - first is to modify it, and next is to
move it without modifications? I think this makes review process
significantly easier. And I wonder how Philippe and Peter reviewed
this whole thing, as the changes in ae2086426d37 are rather large.
If it were me, I'd had a difficult time reviewing this change.
Thanks,
/mjt