Commit 68779c62 authored by Haibin Wang's avatar Haibin Wang Committed by Jiri Slaby

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

commit 30c21170 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: default avatarHaibin Wang <wanghaibin.wang@huawei.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: default avatarShannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent bc1a23b6
...@@ -1475,10 +1475,11 @@ static int vgic_ioaddr_assign(struct kvm *kvm, phys_addr_t *ioaddr, ...@@ -1475,10 +1475,11 @@ static int vgic_ioaddr_assign(struct kvm *kvm, phys_addr_t *ioaddr,
if (addr + size < addr) if (addr + size < addr)
return -EINVAL; return -EINVAL;
*ioaddr = addr;
ret = vgic_ioaddr_overlap(kvm); ret = vgic_ioaddr_overlap(kvm);
if (ret) if (ret)
return ret; *ioaddr = VGIC_ADDR_UNDEF;
*ioaddr = addr;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment