FreeBSD/src c6aba52 (r340441)sys/x86/x86 msi.c

Revert r332735 and fix MSI-X to properly fail allocations when full.

The off-by-one errors in 332735 weren't actual errors and were
preventing the last MSI interrupt source from being used.  Instead,
the issue is that when all MSI interrupt sources were allocated, the
loop in msix_alloc() would terminate with 'msi' still set to non-null.
The only check for 'i' overflowing was in the 'msi' == NULL case, so
msix_alloc() would try to reuse the last MSI interrupt source instead
of failing.

Fix by moving the check for all sources being in use to just after the
loop.

Reviewed by:    kib, markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D17976
DeltaFile
+7-6sys/x86/x86/msi.c
+7-61 files

UnifiedSplitRaw