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: 4092791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A422DBFF02 for ; Wed, 30 Apr 2014 11:19:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D642C20268 for ; Wed, 30 Apr 2014 11:19:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A53920263 for ; Wed, 30 Apr 2014 11:19:26 +0000 (UTC) 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xrBRPZ4rI2/cXFhCepKtSmaKjLKD69SytQYrKtwY680=; b=BOypgSo8SbKl9DkZsb8jQDcy1UyPSQ+3Ri41td4+fdRNKt/qKjP6X8hfkJ24N0g6Tw yUpU/x9t3+ipehZSA4Qdg6rX+hEdRf7TgUaJefd+DTR2LuK9WbE6n2CHc7YY2JAAU69C /CZbvF+uiV2W3IXII7XCyQg6iJtBNx6zIxx4s4CLrSIkUbN/o5XO0+ppy8ehJzNHbEwy ypw2Q9GXuVURCF8oBqzf3xXJVzZp8agkAdto7hF6r9I2nUjQaSNO9xrqe2wtld0ufCNk klcwknqKYxfXn6iWmo0E3F8p3jwqzNviYt73w3dHpjcvtHw/RDEaxOROVF3YfeAzX4b2 ceIg== X-Gm-Message-State: ALoCoQnQVMa50hkjvM0hCBrJGymHpBmi6aMKiObTVosBzmu3cPPQ2ZJRCkGdSf7UQf3NUEWc94Kt 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 (/) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }