Skip to contentSkip to conversation

KVM: arm64: vgic-its: Reword the comment on a collection-less ITE

PATCH Applied Fuad Tabba 3 participants 3 messages Aug 17 – Sep 14

Subsystems (2)
lore
Share & tools
lore

Fuad Tabba

author reviewer
#0 lore raw

PATCH 1/1 KVM: arm64: vgic-its: Reword the comment on a collection-less ITE

The comment above the NULL collection check in vgic_its_save_ite() names only MAPC with V=0, which is UNPREDICTABLE. The route that requires the check is clearing GITS_BASER<coll>.Valid on a disabled ITS, a legitimate operation that orphans every ITE at once. Name both routes.

No functional change intended.

---

Notes:
Based on kvmarm/next, since the comment this reworks was added by c6c156d931c3 ("KVM: arm64: vgic-its: Don't dereference a NULL collection on ITT save") and is not in a release yet.

 arch/arm64/kvm/vgic/vgic-its.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kvm/vgic/vgic-its.c +3 -3
index f6538b1976f9b..26c665e0a2386 100644
@@ -2112,9 +2112,9 @@ static int vgic_its_save_ite(struct vgic_its *its, struct its_device *dev,
 	u64 val;
 
 	/*
-	 * MAPC with V=0 keeps the ITEs mapped but drops their collection,
-	 * and with it the ICID. Save a zeroed entry, which the restore path
-	 * reads back as invalid.
+	 * MAPC with V=0 and clearing GITS_BASER<coll>.Valid both keep the
+	 * ITEs mapped while dropping their collection, and with it the ICID.
+	 * Save a zeroed entry, which the restore path reads back as invalid.
 	 */
 	if (!ite->collection)
 		return vgic_its_write_entry_lock(its, gpa, 0ULL, ite);

base-commit: 57e7cf13ac26bf1a3dba6cfa601f7b2481811575

Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Fuad Tabba

The comment above the NULL collection check in vgic_its_save_ite() names only MAPC with V=0, which is UNPREDICTABLE. The route that requires the check is clearing GITS_BASER<coll>.Valid on a disabled ITS, a legitimate operation that orphans every ITE at once. Name both routes.

No functional change intended.

Eric

Quoted 29 lines

---

Notes:
Based on kvmarm/next, since the comment this reworks was added by c6c156d931c3 ("KVM: arm64: vgic-its: Don't dereference a NULL collection on ITT save") and is not in a release yet.

 arch/arm64/kvm/vgic/vgic-its.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kvm/vgic/vgic-its.c +3 -3
index f6538b1976f9b..26c665e0a2386 100644
@@ -2112,9 +2112,9 @@ static int vgic_its_save_ite(struct vgic_its *its, struct its_device *dev,
 	u64 val;
 
 	/*
-	 * MAPC with V=0 keeps the ITEs mapped but drops their collection,
-	 * and with it the ICID. Save a zeroed entry, which the restore path
-	 * reads back as invalid.
+	 * MAPC with V=0 and clearing GITS_BASER<coll>.Valid both keep the
+	 * ITEs mapped while dropping their collection, and with it the ICID.
+	 * Save a zeroed entry, which the restore path reads back as invalid.
 	 */
 	if (!ite->collection)
 		return vgic_its_write_entry_lock(its, gpa, 0ULL, ite);

base-commit: 57e7cf13ac26bf1a3dba6cfa601f7b2481811575

maintainer Applied
#2 lore raw
In reply to Fuad Tabba
Quoted 9 lines · Fuad Tabba

The comment above the NULL collection check in vgic_its_save_ite() names only MAPC with V=0, which is UNPREDICTABLE. The route that requires the check is clearing GITS_BASER<coll>.Valid on a disabled ITS, a legitimate operation that orphans every ITE at once. Name both routes.

No functional change intended.

[...]

Applied to next, thanks!

[1/1] KVM: arm64: vgic-its: Reword the comment on a collection-less ITE

      commit: 356abf7cedff742621c9b7ae8ecfa7d0febb0b9e

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.