Page MenuHomeFreeBSD

intr/x86: replace use of vector in interface with intsrc
AcceptedPublic

Authored by ehem_freebsd_m5p.com on Jun 2 2022, 2:40 PM.

Details

Reviewers
kib
markj
jhb
Summary

Several x86 interrupt core functions were already operating on intsrc
structures. Now switch the remaining 4 to intsrc for consistency.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 45848
Build 42736: arc lint + arc unit

Event Timeline

Came up as part of guess what. Upon examination it turns out the Xen event channel (interrupt equivalent) code only needs to preserve the interrupt number for calling intr_add_handler() and intr_describe(). Add variants which instead accept the struct intsrc and the Xen code could simply discard the interrupt number.

The one issue is where the isrc == NULL check should be? Should the _intsrc variants be able to deal with being passed NULL sources?

I should add, intr_bind() and intr_config_intr() also seem good candidates for this treatment. I though cannot cite any places which would currently benefit from the functionality.

Came up as part of guess what. Upon examination it turns out the Xen event channel (interrupt equivalent) code only needs to preserve the interrupt number for calling intr_add_handler() and intr_describe(). Add variants which instead accept the struct intsrc and the Xen code could simply discard the interrupt number.

Given that the amount of churn involved looks to be minimal, and since some of the public functions here already operate on intsrcs, I would suggest simply changing the existing functions to take an intsrc, and then handle lookups in nexus. intr_lookup_source() is already used extensively in consumers.

The one issue is where the isrc == NULL check should be? Should the _intsrc variants be able to deal with being passed NULL sources?

Existing intr_* functions which take an intsrc do not perform such a check, so I would not attempt to handle NULL in the new variants either.

Updating per @markj's comment. I'm unsure whether any portions of the nexus code can assume the interrupt number is valid and skip the == NULL check.

ehem_freebsd_m5p.com retitled this revision from intr/x86: add intsrc variants of functions to intr/x86: replace use of vector in interface with intsrc.Jun 4 2022, 12:01 AM
ehem_freebsd_m5p.com edited the summary of this revision. (Show Details)
ehem_freebsd_m5p.com added a subscriber: royger.

Looks reasonable to me.

This revision is now accepted and ready to land.Jun 5 2022, 3:25 PM

Available in a form handy to git at https://gitlab.com/ehem/freebsd-src.git branches "D35386" and "D35406". I suspect I'll be asking @royger to push fairly soon though.