diff options
author | Haibin Wang <wanghaibin.wang@huawei.com> | 2014-04-29 02:49:17 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2014-04-29 05:01:43 -0400 |
commit | 30c2117085bc4e05d091cee6eba79f069b41a9cd (patch) | |
tree | a07810b547b1070617298406e7e71f0cd2c098d5 /virt | |
parent | f2ae85b2ab3776b9e4e42e5b6fa090f40d396794 (diff) |
KVM: ARM: vgic: Fix the overlap check action about setting the GICD & GICC base address.
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>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/arm/vgic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index f9af48c9eb37..56ff9bebb577 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c | |||
@@ -1667,10 +1667,11 @@ static int vgic_ioaddr_assign(struct kvm *kvm, phys_addr_t *ioaddr, | |||
1667 | if (addr + size < addr) | 1667 | if (addr + size < addr) |
1668 | return -EINVAL; | 1668 | return -EINVAL; |
1669 | 1669 | ||
1670 | *ioaddr = addr; | ||
1670 | ret = vgic_ioaddr_overlap(kvm); | 1671 | ret = vgic_ioaddr_overlap(kvm); |
1671 | if (ret) | 1672 | if (ret) |
1672 | return ret; | 1673 | *ioaddr = VGIC_ADDR_UNDEF; |
1673 | *ioaddr = addr; | 1674 | |
1674 | return ret; | 1675 | return ret; |
1675 | } | 1676 | } |
1676 | 1677 | ||