PCI/MSI: Validate MSI-X contiguous restriction early
authorThomas Gleixner <tglx@linutronix.de>
Fri, 11 Nov 2022 13:55:12 +0000 (14:55 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 17 Nov 2022 14:15:22 +0000 (15:15 +0100)
commit4644d22eb673f173252610a93aaaba4c2bff7b41
tree3f28c4ebe72b6baec02f4104f0d20fd78404fe55
parent99f3d279765725920aa5924fa445537a20129a6f
PCI/MSI: Validate MSI-X contiguous restriction early

With interrupt domains the sanity check for MSI-X vector validation can be
done _before_ any allocation happens. The sanity check only applies to the
allocation functions which have an 'entries' array argument. The entries
array is filled by the caller with the requested MSI-X indices. Some drivers
have gaps in the index space which is not supported on all architectures.

The PCI/MSI irq domain has a 'feature' bit to enforce this validation late
during the allocation phase.

Just do it right away before doing any other work along with the other
sanity checks on that array.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20221111122015.691357406@linutronix.de
drivers/pci/msi/msi.c