]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/gic-v3: Only provision redistributors that are enabled in ACPI
authorMarc Zyngier <maz@kernel.org>
Mon, 16 Dec 2019 11:24:57 +0000 (11:24 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 28 Jan 2020 13:17:46 +0000 (13:17 +0000)
commitaefe6a00dc416d019605bf16a646efcfddaaf2fc
treee398bec7077ffd76deccea742da947a7b962ae46
parenta2b14935d4c62c4926517bdea77c90c67a40be8e
irqchip/gic-v3: Only provision redistributors that are enabled in ACPI

We currently allocate redistributor region structures for
individual redistributors when ACPI doesn't present us with
compact MMIO regions covering multiple redistributors.

It turns out that we allocate these structures even when
the redistributor is flagged as disabled by ACPI. It works
fine until someone actually tries to tarse one of these
structures, and access the corresponding MMIO region.

Instead, track the number of enabled redistributors, and
only allocate what is required. This makes sure that there
is no invalid data to misuse.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reported-by: Heyi Guo <guoheyi@huawei.com>
Tested-by: Heyi Guo <guoheyi@huawei.com>
Link: https://lore.kernel.org/r/20191216062745.63397-1-guoheyi@huawei.com
drivers/irqchip/irq-gic-v3.c