Index | Thread | Search

From:
Dave Voutila <dv@sisu.io>
Subject:
Re: [PATCH 5/6] vmd: only assert IRQ0 for i8253 channel 0
To:
ssnf <ssnf@ssnf.xyz>
Cc:
tech@openbsd.org
Date:
Fri, 28 Aug 2026 15:51:34 -0400

Download raw body.

Thread
ssnf <ssnf@ssnf.xyz> writes:

> 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.

This looks good to me to and will commit unless I hear objections.

> ---
>  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