Hi,

Xen community is currently reviewing a new implementation for reading I{S,C}ACTIVER registers (see [1]).

The implementation is based on vgic_mmio_read_active() in KVM, i.e the active state of the interrupts is based on the vGIC state stored in memory.

While reviewing the patch on xen-devel, I noticed a potential deadlock at least with Xen implementation. I know that Xen vGIC and KVM vGIC are quite different, so I looked at the implementation to see how this is dealt.

With my limited knowledge of KVM, I wasn't able to rule it out. I am curious to know if I missed anything.

vCPU A may read the active state of an interrupt routed to vCPU B. When vCPU A is reading the state, it will read the state stored in memory.

The only way the memory state can get synced with the HW state is when vCPU B exit guest context.

AFAICT, vCPU B will not exit when deactivating HW mapped interrupts and virtual edge interrupts. So vCPU B may run for an abritrary long time before been exiting and syncing the memory state with the HW state.

Looking at Linux (5.4 and onwards) use of the active state, vCPU A would loop until the interrupt is not active anymore. So wouldn't the task on vCPU A be blocked for an arbitrary long time?

Cheers,

[1] https://lists.xenproject.org/archives/html/xen-devel/2020-03/msg01844.html

--
Julien Grall
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to