On 06/09/2021 10:04, Hongda Deng wrote:
Hi Julien,
Hi Hongda,
Xen provides vGIC to support Xen guests, and currently xen will return IO
unhandled when guests access GICD ICPENRn registers. This works fine with Linux
guests, for Linux won't access these registers. But for Zephyr, this mechanism
will cause IO dataabort on Zephyr's initialization which makes Zephyr get in
fatal error.
One method to ease this is to let vGIC ignore GICD ICPENRn registers access. I
tested it with Linux guests and Zephyr guests, and both works fine. And I found
in this patch[1] that it would be more complex to touch the read part for
I{S,C}PENDR and the write part for ICPENDR,
Read to I{S,C}PENDR should already return. AFAIK, what's left
unimplemented is write to ICPENDR.
so could we ignore GICD ICPENDRn
registers access to ease Zephyr's initialization problem?
Would you be able to provide more information on how Zephyr is using it?
If Xen wants a complete GICD ICPENDRn emulation to fix it, do you have any
suggestions.
Emulating ICPENDR is not easy with the existing vGIC. It would be great
to finally have a vGIC spec compliant, but I also appreciate this is
going to take some time.
Ignoring the access is probably the best we can do. However, this is
also a risky approach because Zephyr (or another OS) may genuinely want
to clear an already pending interrupt. So I would suggest to walk the
interrupts that are meant to be modified and check whether they are
already pending. If they are then print a message.
This would make clear to the developper that something may go wrong
later on.
Cheers,
--
Julien Grall