Page MenuHomeFreeBSD

xen/intr: rework locking, prepare xen_intr_alloc_isrc() for split
Needs ReviewPublic

Authored by ehem_freebsd_m5p.com on Jun 11 2021, 2:56 PM.

Details

Summary

There were actually two distinct locking domains in xen_intr.c, but they
were sharing the same lock. Both xen_intr_port_to_isrc[] and the x86
interrupt structures needed protection. Split these two apart as a
precursor to splitting the architecture portions off the file.

The call structures around xen_intr_alloc_isrc() were rather perverse.
Notably the allocation function should be taking care of locking for
interrupt allocation needs and should also be handling the reuse of
unused interrupts.

Diff Detail

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

Event Timeline

Add more to comment before xen_intr_isrc_lock. Give explicit condition for unlocking.

Small, but significant optimization. The lock doesn't actually need to be held during release, instead things simply need to be clear before it is fully released.

Update due to testing failure, apparently there is no non-sized atomic store-release.

Small formatting cleanup. Other changes makes removing a line now seem cleaner (no functional change from last version).

Update diff to keep synchronized with other diffs. This series has a fair bit of overlap and thus reordering is non-trivial.