linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: arm/arm64: GICv4: Do not perform an map to a mapped vLPI
@ 2023-11-16 12:52 Kunkun Jiang
  2023-11-16 14:10 ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Kunkun Jiang @ 2023-11-16 12:52 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
	Zenghui Yu, Catalin Marinas, Will Deacon, Jean-Philippe Brucker,
	eric.auger
  Cc: linux-arm-kernel, kvmarm, wanghaibin.wang, Kunkun Jiang

Before performing an unmap, let's check whether the vLPI has been
mapped. This corresponds to checking whether a vLPI is valid before
unmap it.

Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
---
 arch/arm64/kvm/vgic/vgic-v4.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c
index 339a55194b2c..824f4baf50ee 100644
--- a/arch/arm64/kvm/vgic/vgic-v4.c
+++ b/arch/arm64/kvm/vgic/vgic-v4.c
@@ -436,6 +436,11 @@ int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int virq,
 	if (ret)
 		goto out;
 
+	if (irq->hw) {
+		ret = -EBUSY;
+		goto out;
+	}
+
 	/*
 	 * Emit the mapping request. If it fails, the ITS probably
 	 * isn't v4 compatible, so let's silently bail out. Holding
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-17 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16 12:52 [PATCH] KVM: arm/arm64: GICv4: Do not perform an map to a mapped vLPI Kunkun Jiang
2023-11-16 14:10 ` Marc Zyngier
2023-11-17  9:54   ` Kunkun Jiang
2023-11-17 11:47     ` Marc Zyngier

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).