summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd
diff options
context:
space:
mode:
authorDave Voutila <dv@cvs.openbsd.org>2023-10-25 12:44:29 +0000
committerDave Voutila <dv@cvs.openbsd.org>2023-10-25 12:44:29 +0000
commitffb1cce4c80a2a0574a78f34ea83278984393050 (patch)
tree417ef56dcf99946348a9a151017bf422e1cd648c /usr.sbin/vmd
parentfbeaa4c020ae4e93f4a56a43a1ddc04f02ded4a4 (diff)
vmd(8): stop toggling irq deassert for edge triggered devs.
For edge-triggered devices, there's no need to deassert an irq given how vmd(8) emulates a pic. Deassertion grabs a lock and can trigger the ioctl for toggling pending interrupts causing a race condition. This results in a storm of vm-exits and guest vcpu becoming unresponsive. The original sign of this issue is guest "pauses" when pasting text into a serial console connection in something like xterm(1). Tested by mbuhl@, cheloha@, sashan@, kn@, and mlarkin@. "go for it", mlarkin@
Diffstat (limited to 'usr.sbin/vmd')
-rw-r--r--usr.sbin/vmd/i8253.c3
-rw-r--r--usr.sbin/vmd/mc146818.c3
-rw-r--r--usr.sbin/vmd/ns8250.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/usr.sbin/vmd/i8253.c b/usr.sbin/vmd/i8253.c
index b98e7bdc69a..9cc06d3f35c 100644
--- a/usr.sbin/vmd/i8253.c
+++ b/usr.sbin/vmd/i8253.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i8253.c,v 1.37 2023/04/14 15:31:17 tb Exp $ */
+/* $OpenBSD: i8253.c,v 1.38 2023/10/25 12:44:28 dv Exp $ */
/*
* Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org>
*
@@ -371,7 +371,6 @@ i8253_fire(int fd, short type, void *arg)
struct i8253_channel *ctr = (struct i8253_channel *)arg;
vcpu_assert_pic_irq(ctr->vm_id, 0, 0);
- vcpu_deassert_pic_irq(ctr->vm_id, 0, 0);
if (ctr->mode != TIMER_INTTC) {
timerclear(&tv);
diff --git a/usr.sbin/vmd/mc146818.c b/usr.sbin/vmd/mc146818.c
index 43dce7b10d1..78139f6917c 100644
--- a/usr.sbin/vmd/mc146818.c
+++ b/usr.sbin/vmd/mc146818.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mc146818.c,v 1.26 2023/04/18 10:27:38 tb Exp $ */
+/* $OpenBSD: mc146818.c,v 1.27 2023/10/25 12:44:28 dv Exp $ */
/*
* Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org>
*
@@ -150,7 +150,6 @@ rtc_fireper(int fd, short type, void *arg)
rtc.regs[MC_REGC] |= MC_REGC_PF;
vcpu_assert_pic_irq((ptrdiff_t)arg, 0, 8);
- vcpu_deassert_pic_irq((ptrdiff_t)arg, 0, 8);
evtimer_add(&rtc.per, &rtc.per_tv);
}
diff --git a/usr.sbin/vmd/ns8250.c b/usr.sbin/vmd/ns8250.c
index bc23876bf03..425531cf6d0 100644
--- a/usr.sbin/vmd/ns8250.c
+++ b/usr.sbin/vmd/ns8250.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ns8250.c,v 1.37 2023/04/18 10:27:38 tb Exp $ */
+/* $OpenBSD: ns8250.c,v 1.38 2023/10/25 12:44:28 dv Exp $ */
/*
* Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org>
*
@@ -82,7 +82,6 @@ ratelimit(int fd, short type, void *arg)
com1_dev.regs.iir &= ~IIR_NOPEND;
vcpu_assert_pic_irq(com1_dev.vmid, 0, com1_dev.irq);
- vcpu_deassert_pic_irq(com1_dev.vmid, 0, com1_dev.irq);
mutex_unlock(&com1_dev.mutex);
}
@@ -160,7 +159,6 @@ com_rcv_event(int fd, short kind, void *arg)
if ((com1_dev.regs.iir & IIR_NOPEND) == 0) {
/* XXX: vcpu_id */
vcpu_assert_pic_irq((uintptr_t)arg, 0, com1_dev.irq);
- vcpu_deassert_pic_irq((uintptr_t)arg, 0, com1_dev.irq);
}
mutex_unlock(&com1_dev.mutex);