Skip to contentSkip to conversation

Configuring the host GIC for guest to guest IPI

DISCUSSION Alex Bennée 2 participants 2 messages Dec 13, 2021 KVM arm64

lore
Share & tools
lore
#0 lore raw

Hi GIC experts,

This came up last week in the Stratos sync call when we were discussing Vincent's SCMI setup:

https://linaro.atlassian.net/wiki/spaces/STR/pages/28665741503/2021-12-09+Project+Stratos+Meeting+Notes

with the shared memory between the two guests the only reason we currently exit to the guest userspace (QEMU) is to forward notifications of virtqueue kicks from one guest to the other. I'm vaguely aware from my time looking at GIC code that it can be configured for IPI IRQs between two cores. Do we have that ability between two vCPUs from different guests?

If not what would it take to enable such a feature?

Signature · 5 lines
Alex Bennée
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
maintainer
#1 lore raw

Hi Alex,

Quoted 8 lines · Alex Bennée

Hi GIC experts,

This came up last week in the Stratos sync call when we were discussing Vincent's SCMI setup:

https://linaro.atlassian.net/wiki/spaces/STR/pages/28665741503/2021-12-09+Project+Stratos+Meeting+Notes

Quoted 8 lines

with the shared memory between the two guests the only reason we currently exit to the guest userspace (QEMU) is to forward notifications of virtqueue kicks from one guest to the other. I'm vaguely aware from my time looking at GIC code that it can be configured for IPI IRQs between two cores. Do we have that ability between two vCPUs from different guests?

If not what would it take to enable such a feature?

SGIs (the interrupt type used to implement IPIs) are by definition local to a system (be it physical or virtual), and the idea of being able to route these outside the system doesn't hold.

So as far as KVM is concerned, this is a strong *never*.

The per-CPU nature of these interrupts is also pretty bad. It means that the guest cannot suspend some CPUs without also losing access to the device/shared memory. Bad.

If you want to generate a signal that is used between VMs, why not use a global interrupt (SPI), where each VM treats the other one as a device rather than a peer? At least the semantics are manageable, and all you need to implement is some irqfd plumbing in both direction, much along the lines of what vfio (and probably vhost) already does for the exact same purpose (signalling in-kernel events to a VM).

	M.
Signature · 5 lines
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm