linux-stable/drivers/pci
Vidya Sagar 9d71d7a9f2 PCI/MSI: Prevent MSI hardware interrupt number truncation
commit db744ddd59 upstream.

While calculating the hardware interrupt number for a MSI interrupt, the
higher bits (i.e. from bit-5 onwards a.k.a domain_nr >= 32) of the PCI
domain number gets truncated because of the shifted value casting to return
type of pci_domain_nr() which is 'int'. This for example is resulting in
same hardware interrupt number for devices 0019:00:00.0 and 0039:00:00.0.

To address this cast the PCI domain number to 'irq_hw_number_t' before left
shifting it to calculate the hardware interrupt number.

Please note that this fixes the issue only on 64-bit systems and doesn't
change the behavior for 32-bit systems i.e. the 32-bit systems continue to
have the issue. Since the issue surfaces only if there are too many PCIe
controllers in the system which usually is the case in modern server
systems and they don't tend to run 32-bit kernels.

Fixes: 3878eaefb8 ("PCI/MSI: Enhance core to support hierarchy irqdomain")
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Shanker Donthineni <sdonthineni@nvidia.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240115135649.708536-1-vidyas@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:21:48 +01:00
..
controller PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq() 2024-03-01 13:21:43 +01:00
endpoint PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled 2022-12-31 13:14:22 +01:00
hotplug Revert "PCI: acpiphp: Reassign resources on bridge if necessary" 2023-12-20 15:17:38 +01:00
pcie PCI/AER: Decode Requester ID when no error info found 2024-02-23 08:54:51 +01:00
switch PCI: switchtec: Fix stdev_release() crash after surprise hot remove 2024-02-23 08:54:50 +01:00
access.c
ats.c
bus.c PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-22 13:31:24 +01:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Enlarge virtfn sysfs name buffer 2023-03-10 09:39:37 +01:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-12-31 13:14:24 +01:00
Kconfig
Makefile
mmap.c
msi.c PCI/MSI: Prevent MSI hardware interrupt number truncation 2024-03-01 13:21:48 +01:00
of.c
p2pdma.c
pci-acpi.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 16:56:28 +00:00
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c PCI: Unify delay handling for reset and resume 2023-03-22 13:31:37 +01:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI/sysfs: Protect driver's D3cold preference from user space 2023-11-28 16:56:28 +00:00
pci.c Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" 2024-01-15 18:51:08 +01:00
pci.h PCI: Fix 64GT/s effective data rate calculation 2024-02-23 08:54:51 +01:00
probe.c
proc.c
quirks.c PCI: Only override AMD USB controller if required 2024-02-23 08:54:50 +01:00
remove.c
rom.c
search.c
setup-bus.c PCI: Take other bus devices into account when distributing resources 2023-03-11 13:57:37 +01:00
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c