OSDN Git Service

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)
commit926b5dfa6b8dc666ff398044af6906b156e1d949
treee398bec7077ffd76deccea742da947a7b962ae46
parentf4a81f5a853e0b7c38bfad3afd6d0365d654e777
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