]> 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)
commit28cd34e8f4a6ddfe2c0e7c6a4e5b515ea63699ec
treee398bec7077ffd76deccea742da947a7b962ae46
parentc18f47823f4175f53b2b6995469964e15845d8d2
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