linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] KVM: ARM: vgic: Fix the overlap check action about setting the GICD & GICC base address.
Date: Wed, 30 Apr 2014 04:15:56 -0700	[thread overview]
Message-ID: <1398856556-13199-6-git-send-email-christoffer.dall@linaro.org> (raw)
In-Reply-To: <1398856556-13199-1-git-send-email-christoffer.dall@linaro.org>

From: Haibin Wang <wanghaibin.wang@huawei.com>

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>
---
 virt/kvm/arm/vgic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index f9af48c..56ff9be 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,
 	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;
 }
 
-- 
1.8.5.2

  parent reply	other threads:[~2014-04-30 11:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 11:15 [GIT PULL] KVM/ARM Fixes for 3.15-rc4 Christoffer Dall
2014-04-30 11:15 ` [PATCH 1/5] ARM: KVM: disable KVM in Kconfig on big-endian systems Christoffer Dall
2014-04-30 11:15 ` [PATCH 2/5] arm: KVM: fix possible misalignment of PGDs and bounce page Christoffer Dall
2014-04-30 11:15 ` [PATCH 3/5] KVM: ARM: vgic: Fix sgi dispatch problem Christoffer Dall
2014-04-30 11:15 ` [PATCH 4/5] KVM: arm/arm64: vgic: fix GICD_ICFGR register accesses Christoffer Dall
2014-04-30 11:15 ` Christoffer Dall [this message]
2014-04-30 19:26 ` [GIT PULL] KVM/ARM Fixes for 3.15-rc4 Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398856556-13199-6-git-send-email-christoffer.dall@linaro.org \
    --to=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).