xen/arm: vgic: Ignore write access to ICPENDR*
authorHongda Deng <Hongda.Deng@arm.com>
Thu, 21 Oct 2021 12:03:19 +0000 (20:03 +0800)
committerJulien Grall <jgrall@amazon.com>
Thu, 21 Oct 2021 17:12:53 +0000 (17:12 +0000)
commit23ec1ebc8acbfd2bf06f6085a776f0db923f9fa9
tree028524b4da56ae40dcb1d6f76fd4ecd028c4a2e3
parent98f60e5de00baf650c574c9352bb19aedb082dea
xen/arm: vgic: Ignore write access to ICPENDR*

Currently, Xen will return IO unhandled when guests write ICPENDR*
virtual registers, which will raise a data abort inside the guest.
For Linux guest, these virtual registers will not be accessed. But
for Zephyr, these virtual registers will be accessed during the
initialization. Zephyr guest will get an IO data abort and crash.
Emulating ICPENDR is not easy with the existing vGIC, this patch
reworks the emulation to ignore write access to ICPENDR* virtual
registers and print a message about whether they are already pending
instead of returning unhandled.
More details can be found at [1].

[1] https://github.com/zephyrproject-rtos/zephyr/blob/eaf6cf745df3807e6e
cc941c3a30de6c179ae359/drivers/interrupt_controller/intc_gicv3.c#L274

Signed-off-by: Hongda Deng <hongda.deng@arm.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/vgic-v2.c
xen/arch/arm/vgic-v3.c
xen/arch/arm/vgic.c
xen/include/asm-arm/vgic.h