Re: [PATCH] irqchip/gic-v3-its: Skip HP notifier when no ITS is registered

From: Marc Zyngier
Date: Wed Feb 02 2022 - 08:30:13 EST


On 2022-02-02 12:50, Valentin Schneider wrote:
On 02/02/22 10:34, Marc Zyngier wrote:
We have some systems out there that have both LPI support and an
ITS, but that don't expose the ITS in their firmware tables
(either because it is broken or because they run under a hypervisor
that hides it...).


Huh :)

Yeah. Got to love these WoA machines where EL2 hides most of the
useful HW, but also can't be bothered to consistently emulate
the registers they trap (cue the bug that was causing the SMMUv2
driver to explode on store of xzr to an MMIO register). Bah.


Is such a configuration, we still register the HP notifier to free
the allocated tables if needed, resulting in a warning as there is
no memory to free (nothing was allocated the first place).


Right, so list_empty(&its_nodes) means no ->pend_page, but still having the
HP notifier means we hit the WARN_ON(!pend_page).

Fix it by keying the HP notifier on the presence of at least one
sucessfully probed ITS.


That looks fine to me.

Reviewed-by: Valentin Schneider <valentin.schneider@xxxxxxx>

Thanks,

M.
--
Jazz is not dead. It just smells funny...