Skip to content

Commit b91f6a8

Browse files
committed
aarch64: raise ARM generic-timer frequency ceiling to 2GHz
The generic-timer frequency sanity check rejected anything above 1GHz. Real server ARM cores run higher: some server ARM cores run at 1GHz and up; one Neoverse-V1 part (Neoverse-V1) passes a 1.05GHz generic-timer frequency to the guest, which tripped the old ceiling and aborted the boot. Raise the ceiling to 2GHz to cover current cores with headroom while still rejecting a garbage read.
1 parent 11168df commit b91f6a8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

arch/aarch64/arm-clock.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ class arm_clock : public clock {
4242

4343
arm_clock::arm_clock() {
4444
asm volatile ("mrs %0, cntfrq_el0; isb; " : "=r"(freq_hz) :: "memory");
45-
/* spec documents a typical range of 1-50 MHZ,
46-
* the ampere-1a however, runs on 1Ghz, so allow up to that frequency */
47-
if (freq_hz < 1 * MHZ || freq_hz > 1000 * MHZ) {
45+
/* spec documents a typical range of 1-50 MHZ, but real cores run higher:
46+
* the ampere-1a runs at 1GHz and AWS Graviton3 (Neoverse-V1) passes a
47+
* 1.05GHz generic-timer frequency through to the guest, so the previous
48+
* 1GHz ceiling aborted the boot. Allow up to 2GHz to cover current server
49+
* ARM cores with headroom while still catching a garbage read. */
50+
if (freq_hz < 1 * MHZ || freq_hz > 2000 * MHZ) {
4851
debug_early_u64("arm_clock(): read invalid frequency ", freq_hz);
4952
abort();
5053
}

0 commit comments

Comments
 (0)