kvm: arm64: vgic: Introduce vgic_check_iorange
authorRicardo Koller <ricarkol@google.com>
Tue, 5 Oct 2021 01:19:11 +0000 (18:19 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 11 Oct 2021 08:31:41 +0000 (09:31 +0100)
commitf25c5e4dafd859b941a4654cbab9eb83ff994bcd
tree6cf231dd1fc8cb78728440de353129d1d3c78f3d
parent9e1ff307c779ce1f0f810c7ecce3d95bbae40896
kvm: arm64: vgic: Introduce vgic_check_iorange

Add the new vgic_check_iorange helper that checks that an iorange is
sane: the start address and size have valid alignments, the range is
within the addressable PA range, start+size doesn't overflow, and the
start wasn't already defined.

No functional change.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-2-ricarkol@google.com
arch/arm64/kvm/vgic/vgic-kvm-device.c
arch/arm64/kvm/vgic/vgic.h