summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2023-08-22 14:18:10 +0200
committerMarc Zyngier <maz@kernel.org>2023-10-12 17:55:21 +0200
commit9404673293b065cbb16b8915530147cac7e80b4d (patch)
tree4bdefb73667c09dec5cccd26c97cf59f37f2cd92 /arch/arm64/include/asm
parentKVM: arm64: POR{E0}_EL1 do not need trap handlers (diff)
downloadlinux-9404673293b065cbb16b8915530147cac7e80b4d.tar.xz
linux-9404673293b065cbb16b8915530147cac7e80b4d.zip
KVM: arm64: timers: Correctly handle TGE flip with CNTPOFF_EL2
Contrary to common belief, HCR_EL2.TGE has a direct and immediate effect on the way the EL0 physical counter is offset. Flipping TGE from 1 to 0 while at EL2 immediately changes the way the counter compared to the CVAL limit. This means that we cannot directly save/restore the guest's view of CVAL, but that we instead must treat it as if CNTPOFF didn't exist. Only in the world switch, once we figure out that we do have CNTPOFF, can we must the offset back and forth depending on the polarity of TGE. Fixes: 2b4825a86940 ("KVM: arm64: timers: Use CNTPOFF_EL2 to offset the physical timer") Reported-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com> Tested-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm')
0 files changed, 0 insertions, 0 deletions