HomeFreeBSD

msi: handle error from BUS_REMAP_INTR in msi_assign_cpu

Description

msi: handle error from BUS_REMAP_INTR in msi_assign_cpu

Previously errors from BUS_REMAP_INTR were silently ignored, and we
ended up with non-functional interrupts.

Now we allocate and enable new vectors, but postpone assignment of new
APIC IDs and vectors where we can, until after BUS_REMAP_INTR is
successful. We then disable and free the old vectors.

If BUS_REMAP_INTR fails we restore the old configuration, and disable
and free the new, unused vectors.

Thanks to AMD for providing hardware (with APIC IDs above 255) for
testing.

Reviewed by: jhb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41455

(cherry picked from commit fa5f94140a83b4704c654ababd67cd9addb7cd29)

Details

Provenance
emasteAuthored on Aug 14 2023, 4:56 PM
Reviewer
jhb
Differential Revision
D41455: msi: report error from BUS_REMAP_INTR
Parents
rG1da381c2bea7: shmfd: hide direct rangelock(9) use under a wrapper
Branches
Unknown
Tags
Unknown