From patchwork Mon May 4 01:52:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47951 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 169772121F for ; Mon, 4 May 2015 01:54:31 +0000 (UTC) Received: by wizk4 with SMTP id k4sf30541789wiz.2 for ; Sun, 03 May 2015 18:54:30 -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=ojheafw2fcb67Kq9iiKE2X9+DLBw99hT3XR5K5rxhVs=; b=N4ndvrMXdcGcU9LhQvVJSZsqidmQybh7RXRqwJ9KeStyh/iveGmOhzQJ2H1888g6m1 epO8utkpmWzY8m+uOrAlpcVkXUGl0dDC00JzKJDAIlooR1PQmfVk/XfLmx73UL26FT8K C2iBx2F1cX/KLJqvtlcbNgjp+P1jtkNfoU0/Nj5D6wziTaM9Nd23ILUeH7X+Pb/K5pbL EL6U9WTu/cRC+3o0+KzVtvFBJlwz0aZIprfQGgBosgj0Lzc0dsxrEN2OODpPa9LBPq+k T4BOSWJS7ZQlXFh/tZa6ZoxDek7clqmfk5Zn/0f/mP4ySyVhr2r92efCP2JGUzIsVcu7 c+eA== X-Gm-Message-State: ALoCoQmhgRpR172zjcKRX+zZG1MzUJZhSBf75wpTSnGlnabCQD47b4ZHZ+2mLZjHtX8yB69PlF5g X-Received: by 10.152.206.36 with SMTP id ll4mr16980313lac.6.1430704470374; Sun, 03 May 2015 18:54:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.73 with SMTP id y9ls713727lay.1.gmail; Sun, 03 May 2015 18:54:30 -0700 (PDT) X-Received: by 10.112.16.167 with SMTP id h7mr17937958lbd.124.1430704470232; Sun, 03 May 2015 18:54:30 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id qc2si9089806lbb.77.2015.05.03.18.54.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2015 18:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagv1 with SMTP id v1so94956147lag.3 for ; Sun, 03 May 2015 18:54:30 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr17279627lac.41.1430704469946; Sun, 03 May 2015 18:54:29 -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 l1csp1412677lbt; Sun, 3 May 2015 18:54:29 -0700 (PDT) X-Received: by 10.70.87.231 with SMTP id bb7mr37766459pdb.70.1430704468910; Sun, 03 May 2015 18:54:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ix6si17838787pac.46.2015.05.03.18.54.28; Sun, 03 May 2015 18:54:28 -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 S1751719AbbEDBy1 (ORCPT + 2 others); Sun, 3 May 2015 21:54:27 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33486 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbbEDBy1 (ORCPT ); Sun, 3 May 2015 21:54:27 -0400 Received: by pacwv17 with SMTP id wv17so147889719pac.0 for ; Sun, 03 May 2015 18:54:27 -0700 (PDT) X-Received: by 10.69.17.68 with SMTP id gc4mr37635324pbd.7.1430704466937; Sun, 03 May 2015 18:54:26 -0700 (PDT) Received: from localhost ([180.150.153.1]) by mx.google.com with ESMTPSA id nt15sm11048368pdb.14.2015.05.03.18.54.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 May 2015 18:54:25 -0700 (PDT) From: shannon.zhao@linaro.org To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, christoffer.dall@linaro.org, shannon.zhao@linaro.org, Haibin Wang Subject: [PATCH for 3.14.y stable 13/47] KVM: ARM: vgic: Fix the overlap check action about setting the GICD & GICC base address. Date: Mon, 4 May 2015 09:52:08 +0800 Message-Id: <1430704362-6292-14-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1430704362-6292-1-git-send-email-shannon.zhao@linaro.org> References: <1430704362-6292-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.215.52 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 2f8aee5..4dc45e2 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; }