mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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
This commit is contained in:
parent
88c756bc9e
commit
f037f5b4b9
7 changed files with 65 additions and 9 deletions
|
@ -956,6 +956,9 @@ struct ArchCPU {
|
|||
*/
|
||||
bool host_cpu_probe_failed;
|
||||
|
||||
/* QOM property to indicate we should use the back-compat CNTFRQ default */
|
||||
bool backcompat_cntfrq;
|
||||
|
||||
/* Specify the number of cores in this CPU cluster. Used for the L2CTLR
|
||||
* register.
|
||||
*/
|
||||
|
@ -2373,6 +2376,14 @@ enum arm_features {
|
|||
ARM_FEATURE_M_SECURITY, /* M profile Security Extension */
|
||||
ARM_FEATURE_M_MAIN, /* M profile Main Extension */
|
||||
ARM_FEATURE_V8_1M, /* M profile extras only in v8.1M and later */
|
||||
/*
|
||||
* ARM_FEATURE_BACKCOMPAT_CNTFRQ makes the CPU default cntfrq be 62.5MHz
|
||||
* if the board doesn't set a value, instead of 1GHz. It is for backwards
|
||||
* compatibility and used only with CPU definitions that were already
|
||||
* in QEMU before we changed the default. It should not be set on any
|
||||
* CPU types added in future.
|
||||
*/
|
||||
ARM_FEATURE_BACKCOMPAT_CNTFRQ, /* 62.5MHz timer default */
|
||||
};
|
||||
|
||||
static inline int arm_feature(CPUARMState *env, int feature)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue