]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
irqchip/gic-v2m: Handle Multiple MSI base IRQ Alignment
authorChristian Bruel <christian.bruel@foss.st.com>
Tue, 2 Sep 2025 09:10:45 +0000 (11:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:07 +0000 (12:45 +0100)
commit3eeccdb6b099eb5c20a2151096d5d5845d74fce9
tree495f9cdde37c188711c4367d2a4105c614c38db2
parent5d4f0c29f34a85a4c91c380a2d2270fb86555f09
irqchip/gic-v2m: Handle Multiple MSI base IRQ Alignment

[ Upstream commit 2ef3886ce626dcdab0cbc452dbbebc19f57133d8 ]

The PCI Local Bus Specification 3.0 (section 6.8.1.6) allows modifying the
low-order bits of the MSI Message DATA register to encode nr_irqs interrupt
numbers in the log2(nr_irqs) bits for the domain.

The problem arises if the base vector (GICV2m base spi) is not aligned with
nr_irqs; in this case, the low-order log2(nr_irqs) bits from the base
vector conflict with the nr_irqs masking, causing the wrong MSI interrupt
to be identified.

To fix this, use bitmap_find_next_zero_area_off() instead of
bitmap_find_free_region() to align the initial base vector with nr_irqs.

Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/all/20250902091045.220847-1-christian.bruel@foss.st.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/irqchip/irq-gic-v2m.c