<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/pci/msi, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/pci/msi?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/pci/msi?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-02-04T08:54:20Z</updated>
<entry>
<title>PCI/MSI: Remove bogus warning in pci_irq_get_affinity()</title>
<updated>2022-02-04T08:54:20Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-01-31T21:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=dd7f5a11ac5a6f733f422dc22b4d145d3260304e'/>
<id>urn:sha1:dd7f5a11ac5a6f733f422dc22b4d145d3260304e</id>
<content type='text'>
The recent overhaul of pci_irq_get_affinity() introduced a regression when
pci_irq_get_affinity() is called for an MSI-X interrupt which was not
allocated with affinity descriptor information.

The original code just returned a NULL pointer in that case, but the rework
added a WARN_ON() under the assumption that the corresponding WARN_ON() in
the MSI case can be applied to MSI-X as well.

In fact the MSI warning in the original code does not make sense either
because it's legitimate to invoke pci_irq_get_affinity() for a MSI
interrupt which was not allocated with affinity descriptor information.

Remove it and just return NULL as the original code did.

Fixes: f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()")
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/87ee4n38sm.ffs@tglx

</content>
</entry>
<entry>
<title>PCI/MSI: Prevent UAF in error path</title>
<updated>2022-01-21T01:14:46Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2022-01-19T17:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a0af3d1104f752b6d0dba71788e3fddd67c857a7'/>
<id>urn:sha1:a0af3d1104f752b6d0dba71788e3fddd67c857a7</id>
<content type='text'>
When the core MSI allocation fails, then the PCI/MSI code uses an already
freed MSI descriptor to unmask the MSI mask register in order to bring it back
into reset state.

Remove MSI_FLAG_FREE_MSI_DESCS from the PCI/MSI irqdomain flags and let the
PCI/MSI code free the MSI descriptors after usage.

Fixes: 0f62d941acf9 ("genirq/msi: Provide msi_domain_alloc/free_irqs_descs_locked()")
Reported-by: Tong Zhang &lt;ztong0001@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Tong Zhang &lt;ztong0001@gmail.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/87r1938vbn.ffs@tglx
</content>
</entry>
<entry>
<title>PCI/MSI: Unbreak pci_irq_get_affinity()</title>
<updated>2021-12-18T19:33:21Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-18T10:25:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d558285413ea2f934ab90223ba908c30c5113aee'/>
<id>urn:sha1:d558285413ea2f934ab90223ba908c30c5113aee</id>
<content type='text'>
The recent cleanup of pci_irq_get_affinity() broke the function for
PCI/MSI-X and indices &gt; 0. Only the MSI descriptor for PCI/MSI has more
than one affinity mask which can be retrieved via the MSI index.

PCI/MSI-X has one descriptor per vector and each has a single affinity
mask.

Use index 0 when accessing the affinity mask in the MSI descriptor when
MSI-X is enabled.

Fixes: f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()")
Reported-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://lore.kernel.org/r/87v8zm9pmd.ffs@tglx


</content>
</entry>
<entry>
<title>PCI/MSI: Use msi_on_each_desc()</title>
<updated>2021-12-16T21:22:18Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-06T22:51:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ae24e28fef14687a26f98050e64153b8e4fee7c7'/>
<id>urn:sha1:ae24e28fef14687a26f98050e64153b8e4fee7c7</id>
<content type='text'>
Use the new iterator functions which pave the way for dynamically extending
MSI-X vectors.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20211206210748.142603657@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Let core code free MSI descriptors</title>
<updated>2021-12-16T21:22:17Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-06T22:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9fb9eb4b59acc607e978288c96ac7efa917153d4'/>
<id>urn:sha1:9fb9eb4b59acc607e978288c96ac7efa917153d4</id>
<content type='text'>
Set the domain info flag which tells the core code to free the MSI
descriptors from msi_domain_free_irqs() and add an explicit call to the
core function into the legacy code.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20211206210748.089085131@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Use msi_add_msi_desc()</title>
<updated>2021-12-16T21:22:17Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-06T22:51:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=71020a3c0dff4a00d96922a4a95a067f524a7dcb'/>
<id>urn:sha1:71020a3c0dff4a00d96922a4a95a067f524a7dcb</id>
<content type='text'>
Simplify the allocation of MSI descriptors by using msi_add_msi_desc()
which moves the storage handling to core code and prepares for dynamic
extension of the MSI-X vector space.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20211206210748.035348646@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Protect MSI operations</title>
<updated>2021-12-16T21:22:17Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-06T22:51:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5512c5eaf533a98d33a8dc0dcf415e72773184c8'/>
<id>urn:sha1:5512c5eaf533a98d33a8dc0dcf415e72773184c8</id>
<content type='text'>
To prepare for dynamic extension of MSI-X vectors, protect the MSI
operations for MSI and MSI-X. This requires to move the invocation of
irq_create_affinity_masks() out of the descriptor lock section to avoid
reverse lock ordering vs. CPU hotplug lock as some callers of the PCI/MSI
allocation interfaces already hold it.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20211206210747.982292705@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Simplify pci_irq_get_affinity()</title>
<updated>2021-12-16T21:16:41Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-10T22:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f48235900182d64537c6e8f8dc0932b57a1a0638'/>
<id>urn:sha1:f48235900182d64537c6e8f8dc0932b57a1a0638</id>
<content type='text'>
Replace open coded MSI descriptor chasing and use the proper accessor
functions instead.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211210221814.900929381@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Use msi_get_virq() in pci_get_vector()</title>
<updated>2021-12-16T21:16:41Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-10T22:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=82ff8e6b78fc4587a4255301f0a283506daf11b6'/>
<id>urn:sha1:82ff8e6b78fc4587a4255301f0a283506daf11b6</id>
<content type='text'>
Use msi_get_vector() and handle the return value to be compatible.

No functional change intended.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211210221814.841243231@linutronix.de

</content>
</entry>
<entry>
<title>PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS</title>
<updated>2021-12-16T21:16:40Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-12-10T22:19:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7a823443e9b4ed1ff4a3026d184f09d23fd6d9c9'/>
<id>urn:sha1:7a823443e9b4ed1ff4a3026d184f09d23fd6d9c9</id>
<content type='text'>
Provide a domain info flag which makes the core code check for a contiguous
MSI-X index on allocation. That's simpler than checking it at some other
domain callback in architecture code.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://lore.kernel.org/r/20211210221814.662401116@linutronix.de


</content>
</entry>
</feed>
