Subject: Re: Bug in x86 ioapic interrupt code for devices with shared
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: port-i386
Date: 03/03/2006 15:57:14
On Fri, 3 Mar 2006 15:33:10 -0500 (EST)
der Mouse <mouse@Rodents.Montreal.QC.CA> wrote:

> I know of no examples of (b), but I see no reason why one couldn't
> exist.  As a reasonably plausible example, consider a network card with
> onboard buffering for incoming packets; when its buffer space gets low
> (and presumably on other conditions), it interrupts and you pick up
> packets.  But if you get an interrupt and you find packets pending, you
> don't know whether it has interrupted for them or not - it may depend
> on things such as possible other uses of its onboard memory.  (Maybe
> it's got multiple ports on the back with a small switch built in, and
> the switch buffers are shared with the buffers used for host packets.)

More to the point, think of polling devices, and consider interrupts a
hint to poll the device.  Whether or not the device itself generated
the interrupt is quite irrelevant to correct behavior of the polling
routine.