Index | Thread | Search

From:
ssnf <ssnf@ssnf.xyz>
Subject:
[PATCH 5/6] vmd: only assert IRQ0 for i8253 channel 0
To:
tech@openbsd.org
Cc:
ssnf <ssnf@ssnf.xyz>
Date:
Sat, 22 Aug 2026 19:02:46 +0000

Download raw body.

Thread
Only PIT channel 0 is connected to IRQ0.

i8253_fire() currently asserts IRQ0 for callbacks from all three
channels, generating spurious timer interrupts on channels 1 and 2.
---
 usr.sbin/vmd/i8253.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/vmd/i8253.c b/usr.sbin/vmd/i8253.c
index 3723bcde639..d769b6d8e69 100644
--- a/usr.sbin/vmd/i8253.c
+++ b/usr.sbin/vmd/i8253.c
@@ -374,7 +374,8 @@ i8253_fire(int fd, short type, void *arg)
 	struct timeval tv;
 	struct i8253_channel *ctr = (struct i8253_channel *)arg;
 
-	vcpu_assert_irq(ctr->vm_id, 0, 0);
+	if (ctr == &i8253_channel[0])
+		vcpu_assert_irq(ctr->vm_id, 0, 0);
 
 	if (ctr->mode != TIMER_INTTC) {
 		timerclear(&tv);
-- 
2.51.0