[PATCH v2 20/45] KVM: arm64: Revamp vgic maintenance interrupt configuration
Oliver Upton
oupton at kernel.org
Tue Nov 11 16:08:37 PST 2025
On Sun, Nov 09, 2025 at 05:15:54PM +0000, Marc Zyngier wrote:
> +static void summarize_ap_list(struct kvm_vcpu *vcpu,
> + struct ap_list_summary *als)
> {
> struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
> struct vgic_irq *irq;
> - int count = 0;
> -
> - *multi_sgi = false;
>
> lockdep_assert_held(&vgic_cpu->ap_list_lock);
>
> - list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
> - int w;
> + *als = (typeof(*als)){};
>
> - raw_spin_lock(&irq->irq_lock);
> - /* GICv2 SGIs can count for more than one... */
> - w = vgic_irq_get_lr_count(irq);
> - raw_spin_unlock(&irq->irq_lock);
> + list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
> + scoped_guard(raw_spinlock, &irq->irq_lock) {
> + if (vgic_target_oracle(irq) != vcpu)
> + continue;
>From our conversation about this sort of thing a few weeks ago, wont
this 'continue' interact pooly with the for loop that scoped_guard()
expands to?
Consistent with the other checks against the destination oracle you'll
probably want a branch hint too.
Thanks,
Oliver
More information about the linux-arm-kernel
mailing list