Page MenuHomeFreeBSD

Fix PIC IRR handling for level-triggered pins.
ClosedPublic

Authored by neel on Dec 14 2014, 1:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 2, 8:34 AM
Unknown Object (File)
Sun, Nov 2, 8:34 AM
Unknown Object (File)
Sun, Nov 2, 4:22 AM
Unknown Object (File)
Mon, Oct 27, 2:37 AM
Unknown Object (File)
Sep 28 2025, 2:30 AM
Unknown Object (File)
Sep 1 2025, 4:37 PM
Unknown Object (File)
Aug 31 2025, 6:22 PM
Unknown Object (File)
Aug 6 2025, 1:45 AM
Subscribers
None

Details

Summary

For level triggered interrupts clear the PIC IRR bit when the interrupt pin
is deasserted. Prior to this change each assertion on a level triggered irq
pin resulted in two interrupts being delivered to the CPU.

Test Plan

Boot a FreeBSD/i386 guest with 'hint.apic.0.disabled=1' set in the loader.

root@b386:~ # uname -a
FreeBSD b386 10.0-RELEASE FreeBSD 10.0-RELEASE #5: Tue Aug 19 14:32:17 PDT 2014 root@b386:/usr/obj/usr/src/sys/GENERIC i386

Before this change:

vmstat -i

interrupt total rate
irq6: virtio_pci1 2226 222

root@b386:~ # find / > /dev/null # trigger virtio-blk interrupts

vmstat -i

interrupt total rate
irq6: virtio_pci1 24822 1460

Delta is 22596 interrupts

After the change:

vmstat -i

interrupt total rate
irq6: virtio_pci1 1108 123

root@b386:~ # find / > /dev/null # trigger virtio-blk interrupts

vmstat -i

interrupt total rate
irq6: virtio_pci1 12408 653

Delta is 11300 interrupts

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

neel retitled this revision from to Fix PIC IRR handling for level-triggered pins..
neel updated this object.
neel edited the test plan for this revision. (Show Details)
neel added reviewers: tychon, jhb, grehan.
tychon edited edge metadata.

Looks good to me.

This revision is now accepted and ready to land.Dec 14 2014, 7:15 PM