KVM: arm64: vgic: Undo work in failed ITS restores
authorRicardo Koller <ricarkol@google.com>
Tue, 10 May 2022 00:16:33 +0000 (17:16 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 16 May 2022 12:58:04 +0000 (13:58 +0100)
commit8c5e74c90bb522181dfb051fffff3dad702e704d
tree67ec6f091b574d0f942132fa0d16760d81a84439
parenta1ccfd6f6e06eceb632cc29c4f15a32860f05a7e
KVM: arm64: vgic: Undo work in failed ITS restores

Failed ITS restores should clean up all state restored until the
failure. There is some cleanup already present when failing to restore
some tables, but it's not complete. Add the missing cleanup.

Note that this changes the behavior in case of a failed restore of the
device tables.

restore ioctl:
1. restore collection tables
2. restore device tables

With this commit, failures in 2. clean up everything created so far,
including state created by 1.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220510001633.552496-5-ricarkol@google.com
arch/arm64/kvm/vgic/vgic-its.c