Re: [PATCH] KVM: ARM: vgic: Fix the overlap check action about setting the GICD & GICC base address.

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

 



Hi Haibin,

I believe this to be a correct fix. Just a nitpick below.

On Thu, Apr 10 2014 at  1:15:24 pm BST, Haibin Wang <wanghaibin.wang@xxxxxxxxxx> wrote:
> From: Haibin Wang <wanghaibin.wang@xxxxxxxxxx>
>
> Currently below check in vgic_ioaddr_overlap will always succeed,
> because the vgic dist base and vgic cpu base are still kept UNDEF
> after initialization. The code as follows will be return forever.
>
> 	if (IS_VGIC_ADDR_UNDEF(dist) || IS_VGIC_ADDR_UNDEF(cpu))
>                 return 0;
>
> So, before invoking the vgic_ioaddr_overlap, it needs to set the
> corresponding base address firstly.
>
> Signed-off-by: Haibin Wang <wanghaibin.wang@xxxxxxxxxx>
> ---
>  virt/kvm/arm/vgic.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
> index 3e15825..7ba3751 100644
> --- a/virt/kvm/arm/vgic.c
> +++ b/virt/kvm/arm/vgic.c
> @@ -1667,10 +1667,13 @@ static int vgic_ioaddr_assign(struct kvm *kvm, phys_addr_t *ioaddr,
>  	if (addr + size < addr)
>  		return -EINVAL;
>  
> +	*ioaddr = addr;
>  	ret = vgic_ioaddr_overlap(kvm);
> -	if (ret)
> +	if (ret){
> +		*ioaddr = VGIC_ADDR_UNDEF;
>  		return ret;
> -	*ioaddr = addr;
> +	}
> +
>  	return ret;
>  }

You can rewrite this last bit as:
	if (ret)
        	*ioaddr = VGIC_ADDR_UNDEF;
        return ret;

If you repost it with this channge, you can add my
Acked-by: Marc Zyngier <marc.zyngier@xxxxxxx>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny.
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux