Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1740722

[PATCH v2 06/10] KVM: arm/arm64: vgic-its: Always attempt to save/restore device and collection tables

From Eric Auger <eric.auger@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v2 06/10] KVM: arm/arm64: vgic-its: Always attempt to save/restore device and collection tables
Date 2017-09-27 15:30 +0200
Message-ID <uukzw-3iO-35@gated-at.bofh.it> (permalink)
References <uukzv-3iO-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


In case the device table save fails, we currently do not
attempt to save the collection table. However it may
happen that the device table fails because the structures
in memory are inconsistent with device GITS_BASER however
this does not mean collection backup can't be performed and
wouldn't succeed. Same on restore path. Without this patch,
after a reset and in case the device table fails in case of
L1 entry not valid, the guest gets stuck on restore.

Signed-off-by: Eric Auger <eric.auger@redhat.com>

---

candidate to be CC'ed stable
---
 virt/kvm/arm/vgic/vgic-its.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index 720552c..9e6b556 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -2304,12 +2304,9 @@ static int vgic_its_save_tables_v0(struct vgic_its *its)
 	}
 
 	ret = vgic_its_save_device_tables(its);
-	if (ret)
-		goto out;
 
-	ret = vgic_its_save_collection_table(its);
+	ret |= vgic_its_save_collection_table(its);
 
-out:
 	unlock_all_vcpus(kvm);
 	mutex_unlock(&its->its_lock);
 	mutex_unlock(&kvm->lock);
@@ -2336,11 +2333,9 @@ static int vgic_its_restore_tables_v0(struct vgic_its *its)
 	}
 
 	ret = vgic_its_restore_collection_table(its);
-	if (ret)
-		goto out;
 
-	ret = vgic_its_restore_device_tables(its);
-out:
+	ret |= vgic_its_restore_device_tables(its);
+
 	unlock_all_vcpus(kvm);
 	mutex_unlock(&its->its_lock);
 	mutex_unlock(&kvm->lock);
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/10] vITS Migration fixes and reset Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 06/10] KVM: arm/arm64: vgic-its: Always attempt to save/restore device and collection tables Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 03/10] KVM: arm/arm64: vgic-its: Improve error reporting on device table save Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 04/10] KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 09/10] KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 01/10] KVM: arm/arm64: vgic-its: fix return value for restore Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 05/10] KVM: arm/arm64: vgic-its: Check GITS_CBASER validity before processing commands Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:30 +0200
  [PATCH v2 07/10] KVM: arm/arm64: vgic-its: new helper functions to free the caches Eric Auger <eric.auger@redhat.com> - 2017-09-27 15:40 +0200

csiph-web