[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whd4w2wu13O9b5VRKE1b3MoUk89Q_WzhELyqXGAKmfqmQ@mail.gmail.com>
Date: Thu, 6 Apr 2023 12:35:48 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: David Laight <David.Laight@...lab.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Gunthorpe <jgg@...dia.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: revert bab65e48cb064 PCI/MSI Sanitize MSI-X checks
On Thu, Apr 6, 2023 at 4:05 AM David Laight <David.Laight@...lab.com> wrote:
>
> So code like:
> for (i = 0; i < 16; i++)
> msix_tbl[i].entry = i;
> nvec = pci_enable_msix_range(dev, msix_tbl, 1, 16);
> Now returns -22 if the hardware only supports 8 interrupts.
>
> Previously it returned 8.
Does just moving the pci_msix_validate_entries() down to below the
hwsize update code fix it?
IOW, something like this attached patch?
ENTIRELY UNTESTED! This may be seriously broken for some reason, but
it does seem like the current code makes no sense (that "Keep the IRQ
virtual hackery working" comment seems to not possibly be true since
the MSIX nvec has effectively been checked against hwsize by the
pci_msix_validate_entries() code before).
I don't know this code. Thomas?
Linus
View attachment "patch.diff" of type "text/x-patch" (847 bytes)
Powered by blists - more mailing lists