]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 18 Jan 2019 14:08:59 +0000 (14:08 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit0d7bb2e7bf0633078fa5224d8ef47c6c45fdfea9
treefd3ad8e3522e4f7718e6620e5191459400517274
parent2ff23782403c75a76f75468522360e35fd301451
irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size

BugLink: https://bugs.launchpad.net/bugs/1837664
commit 8208d1708b88b412ca97f50a6d951242c88cbbac upstream.

The way we allocate events works fine in most cases, except
when multiple PCI devices share an ITS-visible DevID, and that
one of them is trying to use MultiMSI allocation.

In that case, our allocation is not guaranteed to be zero-based
anymore, and we have to make sure we allocate it on a boundary
that is compatible with the PCI Multi-MSI constraints.

Fix this by allocating the full region upfront instead of iterating
over the number of MSIs. MSI-X are always allocated one by one,
so this shouldn't change anything on that front.

Fixes: b48ac83d6bbc2 ("irqchip: GICv3: ITS: MSI support")
Cc: stable@vger.kernel.org
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/irqchip/irq-gic-v3-its.c