KVM: arm64: vgic: Make kvm_vgic_inject_irq() take a vcpu pointer
authorMarc Zyngier <maz@kernel.org>
Wed, 27 Sep 2023 09:09:01 +0000 (10:09 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Sat, 30 Sep 2023 18:15:43 +0000 (18:15 +0000)
commit9a0a75d3ccee20149587ab740a2dee31ba401ada
treede4b3fc09dc3db846ccd333b95c323a2e448d328
parentce9ecca0238b140b88f43859b211c9fdfd8e5b70
KVM: arm64: vgic: Make kvm_vgic_inject_irq() take a vcpu pointer

Passing a vcpu_id to kvm_vgic_inject_irq() is silly for two reasons:

- we often confuse vcpu_id and vcpu_idx
- we eventually have to convert it back to a vcpu
- we can't count

Instead, pass a vcpu pointer, which is unambiguous. A NULL vcpu
is also allowed for interrupts that are not private to a vcpu
(such as SPIs).

Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230927090911.3355209-2-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/arm.c
arch/arm64/kvm/pmu-emul.c
arch/arm64/kvm/vgic/vgic-irqfd.c
arch/arm64/kvm/vgic/vgic.c
include/kvm/arm_vgic.h