artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2eafc8b
)
i386: lapic_timer_trigger: disable interrupts around lapic_timer_oneshot()
author
cheloha
<cheloha@openbsd.org>
Thu, 9 Feb 2023 01:41:15 +0000
(
01:41
+0000)
committer
cheloha
<cheloha@openbsd.org>
Thu, 9 Feb 2023 01:41:15 +0000
(
01:41
+0000)
lapic_timer_oneshot() is not atomic. We need to disable interrupts
when calling it to ensure the timer reaches a valid state.
Link:
https://marc.info/?l=openbsd-tech&m=167482851403841&w=2
ok mlarkin@
sys/arch/i386/i386/lapic.c
patch
|
blob
|
history
diff --git
a/sys/arch/i386/i386/lapic.c
b/sys/arch/i386/i386/lapic.c
index
3671b31
..
fae8f71
100644
(file)
--- a/
sys/arch/i386/i386/lapic.c
+++ b/
sys/arch/i386/i386/lapic.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: lapic.c,v 1.5
4 2023/01/30 10:49:05 jsg Exp $
*/
+/* $OpenBSD: lapic.c,v 1.5
5 2023/02/09 01:41:15 cheloha Exp $
*/
/* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */
/*-
@@
-271,7
+271,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);
}
/*