]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Default to 1GHz cntfrq for 'max' and new CPUs
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Apr 2024 12:29:13 +0000 (13:29 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 30 Apr 2024 14:14:15 +0000 (15:14 +0100)
commitf037f5b4b91a32bf8f1ec2c8ff92d2d14242adb4
tree61f858d86ef739760e7168e772b7ff1d03ebeb6d
parent88c756bc9e5d38b6e46e631b9875ae954a319ed9
target/arm: Default to 1GHz cntfrq for 'max' and new CPUs

In previous versions of the Arm architecture, the frequency of the
generic timers as reported in CNTFRQ_EL0 could be any IMPDEF value,
and for QEMU we picked 62.5MHz, giving a timer tick period of 16ns.
In Armv8.6, the architecture standardized this frequency to 1GHz.

Because there is no ID register feature field that indicates whether
a CPU is v8.6 or that it ought to have this counter frequency, we
implement this by changing our default CNTFRQ value for all CPUs,
with exceptions for backwards compatibility:

 * CPU types which we already implement will retain the old
   default value. None of these are v8.6 CPUs, so this is
   architecturally OK.
 * CPUs used in versioned machine types with a version of 9.0
   or earlier will retain the old default value.

The upshot is that the only CPU type that changes is 'max'; but any
new type we add in future (whether v8.6 or not) will also get the new
1GHz default.

It remains the case that the machine model can override the default
value via the 'cntfrq' QOM property (regardless of the CPU type).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240426122913.3427983-5-peter.maydell@linaro.org
hw/core/machine.c
target/arm/cpu.c
target/arm/cpu.h
target/arm/cpu64.c
target/arm/internals.h
target/arm/tcg/cpu32.c
target/arm/tcg/cpu64.c