Page MenuHomeFreeBSD

intr/x86: remove ->pic_vector() from x86 interrupt framework
AbandonedPublic

Authored by ehem_freebsd_m5p.com on Jun 5 2022, 7:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 15, 2:19 AM
Unknown Object (File)
Mon, Dec 9, 12:53 PM
Unknown Object (File)
Mon, Dec 9, 3:07 AM
Unknown Object (File)
Tue, Dec 3, 6:30 AM
Unknown Object (File)
Nov 10 2024, 8:08 AM
Unknown Object (File)
Nov 6 2024, 8:53 AM
Unknown Object (File)
Nov 6 2024, 7:25 AM
Unknown Object (File)
Nov 6 2024, 5:38 AM
Subscribers

Details

Reviewers
kib
markj
jhb
Summary

Retrieving the interrupt number from isrcs via a ->pic_vector() function
made sense when the current x86 interrupt framework was implemented.
Now having ->pic_vector() serves to unnecessarily increase complexity,
rather than adding useful functionality as all callers have the valua
readily available.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 56128
Build 53016: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jun 6 2022, 1:01 PM

Taking a look due while considering something else. I'm wondering about the argument order for intr_execute_handlers(). Should the vector argument be last instead of first? The thought is to mimic the argument order of intr_event_handle(). Issue is whether this reduces confusion or increases confusion?

sys/x86/include/intr_machdep.h
150

I would add a new field to struct intsrc in order to store the passed vector in intr_register_source(), so that the caller doesn't need to pass it again in intr_execute_handlers().

Having considered things in various places I'm no longer so sure of this being a good idea. There is merit, but due to a certain case I could see this being reused for major gain. As such marking this as on hold.

Having examined things more, an appropriate place to store the value already exists, but has been underutilized. Mainly isrc->is_event->ie_irq.

I had been pushing trying to remove the interrupt number from intr_event (D32504) since it doesn't work for all architectures. Thing is, it doesn't work for the INTRNG architectures because INTRNG is lazy about allocating the event structure. If INTRNG followed PowerPC and x86, and allocated the event structure during interrupt registration (D40166), I would be in favor of using it for all platforms.

Problem is I'm pretty sure someone (mmel) would be against this since it would conflict with "INTR_SOLO". Issue there is "INTR_SOLO" is stillborn (D35607), yet mmel still wants to keep this future-less blob.

So a decision needs to be made, push the interrupt number towards a common location (D40166) or towards the architecture (D32504). Right now I would tend to favor D40166, but in order to make progress a decision is needed and then potentially pushed over objections.

(note if the D40166 approach wins, then D32504 still has the value of removing the redundant interrupt number lookup)

ehem_freebsd_m5p.com marked an inline comment as done.

Change the approach and use ->is_event->ie_irq for places besides intr_register_source(). Since D35386 is now a parent, the vector value can disappear from xen_arch_isrc_t. msi_irq can also disappear, but that is more involved.