From patchwork Wed Apr 30 11:15:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 29408 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0AC69202FE for ; Wed, 30 Apr 2014 11:18:44 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id fp1sf6550496pdb.2 for ; Wed, 30 Apr 2014 04:18:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=9xXV/tVE0vWkO6QRqBxtzIGurdkJ4em6/lnweQFi0OA=; b=ZGeTy/V4YXmAwDYI2gwj5bk/LQP9mTpY9nUElKXu/T9a0VdKHloORRJqMj+gaCX1+p jNc989gCCy1AHNDEvkS2ldE1edFasDxGylghyD9YxoNNZBHZfqnw18XzcXd/KZQnNfeV SxW6Z7p0yWTcYpR4oUEzKA0/ak4CVLOXFBoxZt0wODmUUCBlPPTSmVPDMfrXKyZpzYig +ayNUIH644zELcZtjePdnXkWF/EDy9uaLCrkCnViAdgzvcIAhaWimWungceAtJ7eZb+M gj2nKNKY1zW5bJveidegMDxk8bvJ5fGgr8usV4LPHgldXEGiQt1C7/oOEzEwBFFc9dS9 OWoQ== X-Gm-Message-State: ALoCoQlJflLKrPslSbEbrTnB+/9XNUWfFFJ+AmAtbGviIhYdEZk2sIYxx9tb6QOO4Pj+sZME8z32 X-Received: by 10.66.188.238 with SMTP id gd14mr2034351pac.18.1398856723760; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.145 with SMTP id h17ls570193qgd.31.gmail; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) X-Received: by 10.52.229.97 with SMTP id sp1mr2877751vdc.23.1398856723624; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id vd8si5223688vdc.214.2014.04.30.04.18.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 04:18:43 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ib6so1953639vcb.33 for ; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr2934225vdx.28.1398856723528; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp270296vcb; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) X-Received: by 10.140.42.165 with SMTP id c34mr4010199qga.40.1398856723138; Wed, 30 Apr 2014 04:18:43 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id j6si10896772qan.9.2014.04.30.04.18.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Apr 2014 04:18:43 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WfSVk-0004uy-0l; Wed, 30 Apr 2014 11:17:12 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WfSVM-0004gr-QJ for linux-arm-kernel@lists.infradead.org; Wed, 30 Apr 2014 11:16:49 +0000 Received: by mail-la0-f43.google.com with SMTP id c6so1116338lan.16 for ; Wed, 30 Apr 2014 04:16:26 -0700 (PDT) X-Received: by 10.112.17.102 with SMTP id n6mr1198100lbd.39.1398856586181; Wed, 30 Apr 2014 04:16:26 -0700 (PDT) Received: from localhost.localdomain (87-51-169-189-static.dk.customer.tdc.net. [87.51.169.189]) by mx.google.com with ESMTPSA id rd5sm25972812lbb.0.2014.04.30.04.16.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 04:16:25 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , Gleb Natapov 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 Message-Id: <1398856556-13199-6-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1398856556-13199-1-git-send-email-christoffer.dall@linaro.org> References: <1398856556-13199-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140430_041649_038153_6F3BCF3B X-CRM114-Status: GOOD ( 12.89 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.43 listed in list.dnswl.org] Cc: kvm@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Haibin Wang , kvmarm@lists.cs.columbia.edu, Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Haibin Wang 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 Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- 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; }