Skip to content

Commit 6849b5e

Browse files
murzinvRussell King
authored andcommitted
ARM: 8955/1: virt: Relax arch timer version check during early boot
Updates to the Generic Timer architecture allow ID_PFR1.GenTimer to have values other than 0 or 1 while still preserving backward compatibility. At the moment, Linux is quite strict in the way it handles this field at early boot and will not configure arch timer if it doesn't find the value 1. Since here use ubfx for arch timer version extraction (hyb-stub build with -march=armv7-a, so it is safe) To help backports (even though the code was correct at the time of writing) Fixes: 8ec58be ("ARM: virt: arch_timers: enable access to physical timers") Acked-by: Marc Zyngier <[email protected]> Signed-off-by: Vladimir Murzin <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 927d780 commit 6849b5e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/arm/kernel/hyp-stub.S

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,9 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE
146146
#if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER)
147147
@ make CNTP_* and CNTPCT accessible from PL1
148148
mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1
149-
lsr r7, #16
150-
and r7, #0xf
151-
cmp r7, #1
152-
bne 1f
149+
ubfx r7, r7, #16, #4
150+
teq r7, #0
151+
beq 1f
153152
mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL
154153
orr r7, r7, #3 @ PL1PCEN | PL1PCTEN
155154
mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL

0 commit comments

Comments
 (0)