irqchip/gic-v3-its: Fix GIC-700 2169019 erratum

Erratum 2169019 might cause a missed doorbell IRQ for a vCPU if
an ITS command or a GICR_INV*R register invalidate remove the
only source of a doorbell for a vCPU and a new VLPI/VSGI is
triggered for the same vCPU while the GIC services the command.

Add an INVDB ITS command for all ITS commands (VMOVI, VCLEAR, INV,
INVALL) and register invalidates (GICR_INVLPIR, GICR_INVALLR) that
actually remove an IRQ; the INVDB command forces the doorbell
generation, if necessary.

A workaround is added after an INV command only to make the
driver logic foolproof, VLPI invalidation is register based on GIC-700,
so there should be no need in sane HW set-ups.

The code could be optimized to avoid a VSYNC in affected ITS commands
when the workaround is applied since added INVDB/SYNC command pair acts
a a sync itself.

Given the frequency with which VMOVI/VCLEAR/INV/INVALL commands are
issued and the execution time in cycles for a VSYNC it is questionable
whether the optimization provides any real benefit therefore the choice
was to keep the VSYNC command to avoid cluttering the driver code for no
real reason.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
4 files changed