Re: [PATCH 5/6] vmd: only assert IRQ0 for i8253 channel 0
Dave Voutila <[email protected]>
| Newsgroups | gmane.os.openbsd.tech |
|---|---|
| Message-ID | <[email protected]> |
ssnf <[email protected]> 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