Skip to content

Commit

Permalink
KVM: ARM: vgic: Fix the overlap check action about setting the GICD &…
Browse files Browse the repository at this point in the history
… GICC base address.

commit 30c2117 upstream.

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@huawei.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Haibin Wang authored and Greg Kroah-Hartman committed May 17, 2015
1 parent 45d0f76 commit ab2fceb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions virt/kvm/arm/vgic.c
Original file line number Diff line number Diff line change
@@ -1667,10 +1667,11 @@ 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)
return ret;
*ioaddr = addr;
*ioaddr = VGIC_ADDR_UNDEF;

return ret;
}

0 comments on commit ab2fceb

Please sign in to comment.