From 18dee2f3901782275c4203a1bfe51c1532468716 Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 31 Jan 2023 19:11:47 +0000 Subject: [PATCH] amd64: lapic_timer_trigger: disable interrupts while configuring timer lapic_timer_oneshot() does three writes. We need to disable interrupts to ensure the timer lands in a valid state. Link: https://marc.info/?l=openbsd-tech&m=167482851403841&w=2 ok mlarkin@ --- sys/arch/amd64/amd64/lapic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c index 1be0bf12918..6c8ccdf2658 100644 --- a/sys/arch/amd64/amd64/lapic.c +++ b/sys/arch/amd64/amd64/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.65 2022/11/10 08:26:54 jmatthew Exp $ */ +/* $OpenBSD: lapic.c,v 1.66 2023/01/31 19:11:47 cheloha Exp $ */ /* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */ /*- @@ -437,7 +437,11 @@ lapic_timer_rearm(void *unused, uint64_t nsecs) void lapic_timer_trigger(void *unused) { + u_long s; + + s = intr_disable(); lapic_timer_oneshot(0, 1); + intr_restore(s); } /* -- 2.20.1