Page MenuHomeFreeBSD

intr/x86: identify IRQ 0 by intsrc instead of vector
AbandonedPublic

Authored by ehem_freebsd_m5p.com on Jun 20 2022, 2:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 13 2024, 9:54 PM
Unknown Object (File)
Nov 10 2024, 8:12 AM
Unknown Object (File)
Oct 11 2024, 12:54 AM
Unknown Object (File)
Oct 3 2024, 8:07 PM
Unknown Object (File)
Oct 3 2024, 6:33 PM
Unknown Object (File)
Oct 1 2024, 7:22 PM
Unknown Object (File)
Oct 1 2024, 2:05 PM
Unknown Object (File)
Sep 27 2024, 3:34 AM
Subscribers

Details

Reviewers
markj
jhb
kib
Summary

The uses of vector in intr_execute_handlers() seem a bit out of place.
Since the intsrc can be checked for whether it is IRQ 0, do that
instead.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46036
Build 42925: arc lint + arc unit

Event Timeline

In case you hadn't guessed from D35386, I'm trying to remove all uses of the interrupt number from the interface aside from intr_register_source() and intr_lookup_source() (those two require it by their very nature). intr_execute_handlers() is trickier than the other uses.

I'm looking at one software PIC-like driver which doesn't really operate on proper IRQs (the Xen event channel) and the interface of intr_execute_handlers() is a bit of a mismatch. I'm now wondering if switching to vlog() would be plausible.

This seems ok, but I wonder how we can get rid of this hack altogether. clkintr_pending is only used when the intel 8254 timer is used as the system eventtimer (i.e., sc->period != 0) and timecounter, so it's entirely unused on contemporary hardware.

WRT to vlog(), I don't see any problem with using that here...

Yeah I was wondering about that. My goal though is getting rid of references to vector, not getting rid of the hack. Ideally this could be handled in a filter function. Perhaps that approach wasn't used in 2003 (ecee5704ed50) since the situation with filters versus handlers wasn't in a stable state.

The value of doing this may simply be to mitigate bugs if someone tries to use an incompletely initialized struct intsrc and mistakenly passes 0. Also during bring-up a driver might use 0 as a placeholder and this could make early bring-up easier. Even though the real issue should be fixed, this still has value.