From patchwork Fri Apr 24 05:27:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47516 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 341EE20553 for ; Fri, 24 Apr 2015 05:32:28 +0000 (UTC) Received: by wizk4 with SMTP id k4sf1566798wiz.2 for ; Thu, 23 Apr 2015 22:32:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ySOd5CgNyCejlPr9vjOEvhFe52SsErFM+sV430rZDFA=; b=fHb7KFzlUFjqBobrjD5EDOSLvfv0yLbRfPCxN3//AvhWVLJJDJGDkmY0LcTywh+vpB aqN3CbWgJfMdRTF5eogMd0VTHqRFbQTgKG2J+x36a8b0dr9m1Y56tiCbhwXuU9DHTGzH nLA2IOmg8pYLDtuh76E1HcP01i617ekDbm8tEcVKWm5mztGxBIWeTRXSdZWoM7KHUe3t UH9xf+DpM0m2768fz6QlQM0yoKvCrhwuTn0VPW674tpP/Nx0uvILqoG1OnhWPCjoK4Jt q0poqKE4+OnVcfp/A3uILGkmkOj0XpMdB+I1og3y2oKnlBeMXELSRqKBLdK7zHNnC7Rm 2Ghw== X-Gm-Message-State: ALoCoQnIoP45/X6mLkrFyoWD86g85ILLzGRvkLJtZJcYZWWOc8UNyic9IDqJsTo0ExggP79Qdbw/ X-Received: by 10.152.37.101 with SMTP id x5mr3203886laj.5.1429853547370; Thu, 23 Apr 2015 22:32:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.67 with SMTP id da3ls490003lad.49.gmail; Thu, 23 Apr 2015 22:32:27 -0700 (PDT) X-Received: by 10.153.5.36 with SMTP id cj4mr5354678lad.69.1429853547085; Thu, 23 Apr 2015 22:32:27 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id o1si7484809lbc.8.2015.04.23.22.32.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 22:32:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbuc2 with SMTP id uc2so28546033lbb.2 for ; Thu, 23 Apr 2015 22:32:26 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr5349469lac.41.1429853546647; Thu, 23 Apr 2015 22:32:26 -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.112.67.65 with SMTP id l1csp978016lbt; Thu, 23 Apr 2015 22:32:25 -0700 (PDT) X-Received: by 10.70.118.36 with SMTP id kj4mr2991731pdb.52.1429853544879; Thu, 23 Apr 2015 22:32:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd10si15800741pdb.178.2015.04.23.22.32.24; Thu, 23 Apr 2015 22:32:24 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754537AbbDXFcX (ORCPT + 2 others); Fri, 24 Apr 2015 01:32:23 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:34625 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754538AbbDXFcX (ORCPT ); Fri, 24 Apr 2015 01:32:23 -0400 Received: by oiko83 with SMTP id o83so32484109oik.1 for ; Thu, 23 Apr 2015 22:32:22 -0700 (PDT) X-Received: by 10.182.48.231 with SMTP id p7mr5780646obn.19.1429853542723; Thu, 23 Apr 2015 22:32:22 -0700 (PDT) Received: from localhost ([167.160.116.36]) by mx.google.com with ESMTPSA id w81sm6097564oia.6.2015.04.23.22.32.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Apr 2015 22:32:21 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: jslaby@suse.cz, christoffer.dall@linaro.org, shannon.zhao@linaro.org, Haibin Wang Subject: [PATCH for 3.12.y stable 31/63] KVM: ARM: vgic: Fix the overlap check action about setting the GICD & GICC base address. Date: Fri, 24 Apr 2015 13:27:29 +0800 Message-Id: <1429853281-6136-32-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> References: <1429853281-6136-1-git-send-email-shannon.zhao@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Haibin Wang 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 Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Shannon Zhao --- 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 74a014c..46221c9 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; }