diff options
author | Haibin Wang <wanghaibin.wang@huawei.com> | 2014-04-29 14:49:17 +0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-04-30 11:15:06 +0200 |
commit | 68779c62b1d0d0af82077e6ff03140e3fd24f940 (patch) | |
tree | 7f49bb0dab8205ea70b32dabea1dbbc76a3eeba5 /virt | |
parent | bc1a23b6ed483568e8443647e9afdcadee2dca5e (diff) | |
download | lwn-68779c62b1d0d0af82077e6ff03140e3fd24f940.tar.gz lwn-68779c62b1d0d0af82077e6ff03140e3fd24f940.zip |
KVM: ARM: vgic: Fix the overlap check action about setting the GICD & GICC base address.
commit 30c2117085bc4e05d091cee6eba79f069b41a9cd 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>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
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 74a014cdcac9..46221c99334f 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1475,10 +1475,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; } |