]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
KVM: arm64: vgic-v5: Fold PPI state for all exposed PPIs
authorSascha Bischoff <Sascha.Bischoff@arm.com>
Wed, 1 Apr 2026 16:21:57 +0000 (16:21 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 Apr 2026 16:52:17 +0000 (17:52 +0100)
commit9c1ac77ddfc90b6292ef63a4fa5ab6f9e4b29981
treeeaa3c8950ee2bfebf773e94949d38f04c6d5282d
parentb3265a1b2bd00335308f27477cecb7702f4bb615
KVM: arm64: vgic-v5: Fold PPI state for all exposed PPIs

GICv5 supports up to 128 PPIs, which would introduce a large amount of
overhead if all of them were actively tracked. Rather than keeping
track of all 128 potential PPIs, we instead only consider the set of
architected PPIs (the first 64). Moreover, we further reduce that set
by only exposing a subset of the PPIs to a guest. In practice, this
means that only 4 PPIs are typically exposed to a guest - the SW_PPI,
PMUIRQ, and the timers.

When folding the PPI state, changed bits in the active or pending were
used to choose which state to sync back. However, this breaks badly
for Edge interrupts when exiting the guest before it has consumed the
edge. There is no change in pending state detected, and the edge is
lost forever.

Given the reduced set of PPIs exposed to the guest, and the issues
around tracking the edges, drop the tracking of changed state, and
instead iterate over the limited subset of PPIs exposed to the guest
directly.

This change drops the second copy of the PPI pending state used for
detecting edges in the pending state, and reworks
vgic_v5_fold_ppi_state() to iterate over the VM's PPI mask instead.

Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Link: https://patch.msgid.link/20260401162152.932243-1-sascha.bischoff@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/hyp/vgic-v5-sr.c
arch/arm64/kvm/vgic/vgic-v5.c