Re: [PATCH 5/7] KVM: arm/arm64: vgic-v4: Only perform an unmap for valid vLPIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 16, 2017 at 05:58:19PM +0000, Marc Zyngier wrote:
> Before performing an unmap, let's check that what we have was
> really mapped the first place.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx>

Reviewed-by: Christoffer Dall <christoffer.dall@xxxxxxxxxx>

> ---
>  virt/kvm/arm/vgic/vgic-v4.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/virt/kvm/arm/vgic/vgic-v4.c b/virt/kvm/arm/vgic/vgic-v4.c
> index 53c324aa44ef..4a37292855bc 100644
> --- a/virt/kvm/arm/vgic/vgic-v4.c
> +++ b/virt/kvm/arm/vgic/vgic-v4.c
> @@ -337,8 +337,10 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int virq,
>  		goto out;
>  
>  	WARN_ON(!(irq->hw && irq->host_irq == virq));
> -	irq->hw = false;
> -	ret = its_unmap_vlpi(virq);
> +	if (irq->hw) {
> +		irq->hw = false;
> +		ret = its_unmap_vlpi(virq);
> +	}
>  
>  out:
>  	mutex_unlock(&its->its_lock);
> -- 
> 2.14.2
> 



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux