Skip to content

Commit 05ce38d

Browse files
Sebastian OttMarc Zyngier
authored andcommitted
KVM: arm64: selftests: Fix xVAL init in arch_timer_edge_cases
arch_timer_edge_cases hits the following assertion in < 10% of the test runs: ==== Test Assertion Failure ==== arm64/arch_timer_edge_cases.c:490: timer_get_cntct(timer) >= DEF_CNT + (timer_get_cntfrq() * (uint64_t)(delta_2_ms) / 1000) pid=17110 tid=17110 errno=4 - Interrupted system call 1 0x0000000000404ec7: test_run at arch_timer_edge_cases.c:945 2 0x0000000000401fa3: main at arch_timer_edge_cases.c:1074 3 0x0000ffffa774b587: ?? ??:0 4 0x0000ffffa774b65f: ?? ??:0 5 0x000000000040206f: _start at ??:? timer_get_cntct(timer) >= DEF_CNT + msec_to_cycles(delta_2_ms) Enabling the timer without proper xval initialization in set_tval_irq() resulted in an early interrupt during timer reprogramming. Make sure to set the xval before setting the enable bit. Signed-off-by: Sebastian Ott <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 050632a commit 05ce38d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ static void set_tval_irq(enum arch_timer timer, uint64_t tval_cycles,
191191
{
192192
atomic_set(&shared_data.handled, 0);
193193
atomic_set(&shared_data.spurious, 0);
194-
timer_set_ctl(timer, ctl);
195194
timer_set_tval(timer, tval_cycles);
195+
timer_set_ctl(timer, ctl);
196196
}
197197

198198
static void set_xval_irq(enum arch_timer timer, uint64_t xval, uint32_t ctl,

0 commit comments

Comments
 (0)