Commit a0d7e2f
committed
KVM: arm64: vgic-v4: Only attempt vLPI mapping for actual MSIs
Some 'creative' VMMs out there may assign a VFIO MSI eventfd to an SPI
routing entry.
And yes, I can already hear you shouting about possibly driving a level
interrupt with an edge-sensitive one. You know who you are.
This works for the most part, and interrupt injection winds up taking
the software path. However, when running on GICv4-enabled hardware, KVM
erroneously attempts to setup LPI forwarding, even though the KVM
routing isn't an MSI.
Thanks to misuse of a union, the MSI destination is unlikely to match any
ITS in the VM and kvm_vgic_v4_set_forwarding() bails early. Later on when
the VM is being torn down, this half-configured state triggers the
WARN_ON() in kvm_vgic_v4_unset_forwarding() due to the fact that no HW
IRQ was ever assigned.
Avoid the whole mess by preventing SPI routing entries from getting into
the LPI forwarding helpers.
Reported-by: Sudheer Dantuluri <[email protected]>
Tested-by: Sudheer Dantuluri <[email protected]>
Fixes: 196b136 ("KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass")
Acked-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Oliver Upton <[email protected]>1 parent 0ad2507 commit a0d7e2f
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2717 | 2717 | | |
2718 | 2718 | | |
2719 | 2719 | | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
2720 | 2728 | | |
2721 | 2729 | | |
2722 | 2730 | | |
| |||
2726 | 2734 | | |
2727 | 2735 | | |
2728 | 2736 | | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
2729 | 2741 | | |
2730 | 2742 | | |
2731 | 2743 | | |
| |||
0 commit comments