* [PATCH v3] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI
@ 2023-11-20 13:12 Kunkun Jiang
2023-11-20 14:30 ` Zenghui Yu
2023-11-20 19:21 ` Oliver Upton
0 siblings, 2 replies; 3+ messages in thread
From: Kunkun Jiang @ 2023-11-20 13:12 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 a map, let's check whether the vLPI has been
mapped.
Fixes: 196b136498b3 ("KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass")
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
Acked-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/kvm/vgic/vgic-v4.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kvm/vgic/vgic-v4.c b/arch/arm64/kvm/vgic/vgic-v4.c
index 339a55194b2c..74a67ad87f29 100644
--- a/arch/arm64/kvm/vgic/vgic-v4.c
+++ b/arch/arm64/kvm/vgic/vgic-v4.c
@@ -436,6 +436,10 @@ int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int virq,
if (ret)
goto out;
+ /* Silently exit if the vLPI is already mapped */
+ if (irq->hw)
+ 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI
2023-11-20 13:12 [PATCH v3] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI Kunkun Jiang
@ 2023-11-20 14:30 ` Zenghui Yu
2023-11-20 19:21 ` Oliver Upton
1 sibling, 0 replies; 3+ messages in thread
From: Zenghui Yu @ 2023-11-20 14:30 UTC (permalink / raw)
To: Kunkun Jiang
Cc: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
Catalin Marinas, Will Deacon, Jean-Philippe Brucker, eric.auger,
linux-arm-kernel, kvmarm, wanghaibin.wang
On 2023/11/20 21:12, Kunkun Jiang wrote:
> Before performing a map, let's check whether the vLPI has been
> mapped.
>
> Fixes: 196b136498b3 ("KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass")
> Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI
2023-11-20 13:12 [PATCH v3] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI Kunkun Jiang
2023-11-20 14:30 ` Zenghui Yu
@ 2023-11-20 19:21 ` Oliver Upton
1 sibling, 0 replies; 3+ messages in thread
From: Oliver Upton @ 2023-11-20 19:21 UTC (permalink / raw)
To: Kunkun Jiang, James Morse, Suzuki K Poulose, Marc Zyngier,
Jean-Philippe Brucker, Zenghui Yu, Will Deacon, eric.auger,
Catalin Marinas
Cc: Oliver Upton, kvmarm, linux-arm-kernel, wanghaibin.wang
On Mon, 20 Nov 2023 21:12:10 +0800, Kunkun Jiang wrote:
> Before performing a map, let's check whether the vLPI has been
> mapped.
>
>
Applied to kvmarm/fixes, thanks!
[1/1] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI
https://git.kernel.org/kvmarm/kvmarm/c/8e4ece6889a5
--
Best,
Oliver
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-20 19:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20 13:12 [PATCH v3] KVM: arm64: GICv4: Do not perform a map to a mapped vLPI Kunkun Jiang
2023-11-20 14:30 ` Zenghui Yu
2023-11-20 19:21 ` Oliver Upton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox