Re: [bug report] GICv4.1: vSGI remains pending across the guest reset

From: Oliver Upton
Date: Sun Dec 17 2023 - 12:34:15 EST


On Sun, Dec 17, 2023 at 11:26:15AM +0000, Marc Zyngier wrote:

[...]

> But this has *nothing* to do with the guest. This is the *host*
> userspace performing a write to the redistributor view, which has
> different semantics. Which is why your earlier description made no
> sense to me.
>
> I think the problem is slightly larger than what you describe. A write
> to ISPENDR0 should be propagated to the ITS for any values of the
> latch, just like this happens on enabling HW-backed SGIs.
>
> Can you please give this a go?

What do you think about using this as an opportunity for a bit of
cleanup? It'd be nice unify the various MMIO and uaccess handlers for
SPENDING + CPENDING while being careful about the arch_timer interrupt.

clear = ~val;
vgic_uaccess_write_spending(val);
vgic_uaccess_write_cpending(clear);

Happy to take your fix too, especially in case I missed something
obvious :)

[*] https://git.kernel.org/pub/scm/linux/kernel/git/oupton/linux.git/log/?h=kvm-arm64/vsgi-spending-fixes

--
Thanks,
Oliver