KVM: arm64: vgic-v3: Refactor GICv3 SGI generation
authorMarc Zyngier <maz@kernel.org>
Wed, 27 Sep 2023 09:09:03 +0000 (10:09 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Sat, 30 Sep 2023 18:15:43 +0000 (18:15 +0000)
commitf3f60a56539108dacfd87b6514398b3970daec54
treee0563e86393b20db3d0a3bd0bf9829868a2bd11c
parentd455d366c451e68781122c693e2e357c673ee807
KVM: arm64: vgic-v3: Refactor GICv3 SGI generation

As we're about to change the way SGIs are sent, start by splitting
out some of the basic functionnality: instead of intermingling
the broadcast and non-broadcast cases with the actual SGI generation,
perform the following cleanups:

- move the SGI queuing into its own helper
- split the broadcast code from the affinity-driven code
- replace the mask/shift combinations with FIELD_GET()
- fix the confusion between vcpu_id and vcpu when handling
  the broadcast case

The result is much more readable, and paves the way for further
optimisations.

Tested-by: Joey Gouly <joey.gouly@arm.com>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230927090911.3355209-4-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/vgic/vgic-mmio-v3.c