- Remove an over-zealous sanity check of the array of MSI-X vectors to

be allocated for a device
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmRFBfsACgkQEsHwGGHe
 VUrwug//Q3850CPw+Sm+DuAL6LNFr8GXDigD/nkhJqPzm2cj7yIr8L4QmFVQAhXt
 2ikyaZtBTVoTmCr2UsdaX5z11wYWxzMBaZGKQS7tUXnKwiIntzadpC7/0F/69y6I
 DMHsCkPrxxOCScriEcH6Tt70SPXBp1zsO7fKFRnGOQiuesoRcBVJz8t9thpUrzfH
 G18BmeIYGd4NoAJg+WOp4EXGLix0uy/ghb03bUCs1UGFAUIy+C7AZFWK4LcXhhS8
 fOiJl1hcvV98RUwO3PWNtxB2c9/E62t9Xc/rAKMjgCCM7dbHxCY0Ftiw0dmcX8ne
 T+7IBTHlsk7iywXCB5xrj52YJoIUI+dgmtvUwMZVwRPK27KjQCZsb9x6sSgmULCz
 ObGWU1ZUPNE9n1NhMD4U2F9avznONeiJhfC7HhP+5TkIr3pIUz7ZdUCsFYUuQ1N6
 nVjndY92ja0WVSxth4uOs2PSsf4o0IbP9owcABdOHvPPFt+CR7szSOYoQ2dXBHZl
 R06h/ZOoKz4bMG/n8JOcjK1IKokx/pU1vt3YAJo6RSR/9VdcZIEt/XuQftLT5A0F
 EzNzBRvsywytvU7X13/ZIEPz7/6Anp78CisrgYcUIbQFhNmQ2ae+9ns48GLBzrx8
 Mf+amryuHA+g+5duDFXi5f0jGH4rTD8PMTYv92nhPtrXyvJtiOw=
 =Vg8O
 -----END PGP SIGNATURE-----

Merge tag 'irq_urgent_for_v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fix from Borislav Petkov:

 - Remove an over-zealous sanity check of the array of MSI-X vectors to
   be allocated for a device

* tag 'irq_urgent_for_v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  PCI/MSI: Remove over-zealous hardware size check in pci_msix_validate_entries()
This commit is contained in:
Linus Torvalds 2023-04-23 08:15:33 -07:00
commit 5ad250f1fe

View File

@ -750,8 +750,7 @@ out_disable:
return ret;
}
static bool pci_msix_validate_entries(struct pci_dev *dev, struct msix_entry *entries,
int nvec, int hwsize)
static bool pci_msix_validate_entries(struct pci_dev *dev, struct msix_entry *entries, int nvec)
{
bool nogap;
int i, j;
@ -762,10 +761,6 @@ static bool pci_msix_validate_entries(struct pci_dev *dev, struct msix_entry *en
nogap = pci_msi_domain_supports(dev, MSI_FLAG_MSIX_CONTIGUOUS, DENY_LEGACY);
for (i = 0; i < nvec; i++) {
/* Entry within hardware limit? */
if (entries[i].entry >= hwsize)
return false;
/* Check for duplicate entries */
for (j = i + 1; j < nvec; j++) {
if (entries[i].entry == entries[j].entry)
@ -805,7 +800,7 @@ int __pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int
if (hwsize < 0)
return hwsize;
if (!pci_msix_validate_entries(dev, entries, nvec, hwsize))
if (!pci_msix_validate_entries(dev, entries, nvec))
return -EINVAL;
if (hwsize < nvec) {