Page MenuHomeFreeBSD

xen/intr: protect xen_intr_port_to_isrc[] during resume
Needs ReviewPublic

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

Details

Summary

The xen_intr_isrc_lock needs to be held while modifying the
xen_intr_port_to_isrc[] array. The lock was missing from
xen_intr_resume().

Diff Detail

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

Event Timeline

Thanks! For the record: the lock is not currently needed given the only caller has APs and interrupts disabled. I'm fine with adding this safeguard, but it should be noted in the commit message IMO that this is not currently an issue.

Also the comment about what what the lock protects should be better added where the lock is defined, as we don't want to be adding such comment at each place where the lock is used.

True enough, I'll add that to the commit message.

D30726 in fact adds such a comment, though I've thought of some text I might add to the comment.

Adding to commit message about not actually being required.

Adding some mtx_assert()s while here. These extra portions do implicitly depend on the lock being held.