linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] KVM: arm/arm64: vgic-its: Properly check the unmapped coll in DISCARD handler
@ 2020-01-14 11:22 Zenghui Yu
  0 siblings, 0 replies; only message in thread
From: Zenghui Yu @ 2020-01-14 11:22 UTC (permalink / raw)
  To: maz
  Cc: andre.przywara, eric.auger, linux-arm-kernel, kvmarm,
	linux-kernel, wanghaibin.wang, Zenghui Yu

Discard is supposed to fail if the collection is not mapped to any
target redistributor. We currently check if the collection is mapped
by "ite->collection" but this is incomplete (e.g., mapping a LPI to
an unmapped collection also results in a non NULL ite->collection).
What actually needs to be checked is its_is_collection_mapped(), let's
turn to it.

Also take this chance to remove an extra blank line.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---

v1->v2:
 - Rewrite the commit message with Eric's suggestion,
   the original one is not so good...
 - Add Eric's R-b

 virt/kvm/arm/vgic/vgic-its.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index 17920d1b350a..d53d34a33e35 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -839,9 +839,8 @@ static int vgic_its_cmd_handle_discard(struct kvm *kvm, struct vgic_its *its,
 	u32 event_id = its_cmd_get_id(its_cmd);
 	struct its_ite *ite;
 
-
 	ite = find_ite(its, device_id, event_id);
-	if (ite && ite->collection) {
+	if (ite && its_is_collection_mapped(ite->collection)) {
 		/*
 		 * Though the spec talks about removing the pending state, we
 		 * don't bother here since we clear the ITTE anyway and the
-- 
2.19.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-14 11:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-14 11:22 [PATCH v2] KVM: arm/arm64: vgic-its: Properly check the unmapped coll in DISCARD handler Zenghui Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).