KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()
authorMarc Zyngier <maz@kernel.org>
Thu, 14 Jul 2022 07:10:09 +0000 (08:10 +0100)
committerMarc Zyngier <maz@kernel.org>
Sun, 17 Jul 2022 10:55:33 +0000 (11:55 +0100)
commit619064afa9b6f0088b86a1fed20c049cfe94cdf7
tree632cde9bc3768ae1c2f501be1f944a82420a5bfd
parent4b85080f4e378f617f88964dec94fd282bcf2af4
KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()

The userspace accessors have an early call to vgic_{get,set}_common_attr()
that makes the code hard to follow. Move it to the default: clause of
the decoding switch statement, which results in a nice cleanup.

This requires us to move the handling of the pending table into the
common handling, even if it is strictly a GICv3 feature (it has the
benefit of keeping the whole control group handling in the same
function).

Also cleanup vgic_v3_{get,set}_attr() while we're at it, deduplicating
the calls to vgic_v3_attr_regs_access().

Suggested-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/vgic/vgic-kvm-device.c