1
0
Fork 0
alistair23-linux/virt/kvm
Wei Huang 8fa7616248 KVM: arm/arm64: arch_timer: Fix CNTP_TVAL calculation
Recently the generic timer test of kvm-unit-tests failed to complete
(stalled) when a physical timer is being used. This issue is caused
by incorrect update of CNTP_CVAL when CNTP_TVAL is being accessed,
introduced by 'Commit 84135d3d18 ("KVM: arm/arm64: consolidate arch
timer trap handlers")'. According to Arm ARM, the read/write behavior
of accesses to the TVAL registers is expected to be:

  * READ: TimerValue = (CompareValue – (Counter - Offset)
  * WRITE: CompareValue = ((Counter - Offset) + Sign(TimerValue)

This patch fixes the TVAL read/write code path according to the
specification.

Fixes: 84135d3d18 ("KVM: arm/arm64: consolidate arch timer trap handlers")
Signed-off-by: Wei Huang <wei@redhat.com>
[maz: commit message tidy-up]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
2019-03-30 10:06:00 +00:00
..
arm KVM: arm/arm64: arch_timer: Fix CNTP_TVAL calculation 2019-03-30 10:06:00 +00:00
Kconfig KVM: arm64: Prevent KVM_COMPAT from being selected 2018-06-21 17:17:50 +01:00
async_pf.c KVM: fix some typos 2018-12-21 11:28:26 +01:00
async_pf.h KVM: fix checkpatch.pl errors in kvm/async_pf.h 2015-06-19 17:16:25 +02:00
coalesced_mmio.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
coalesced_mmio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
eventfd.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
irqchip.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
kvm_main.c ARM: some cleanups, direct physical timer assignment, cache sanitization 2019-03-15 15:00:28 -07:00
vfio.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01:00
vfio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00