Received: by 10.223.164.202 with SMTP id h10csp78478wrb; Thu, 9 Nov 2017 03:04:44 -0800 (PST) X-Google-Smtp-Source: ABhQp+QjeD21oKWgYedVS8oHmw8Y0uoJQ0RKcgSUfJ1qDPA6448bveM730VndM9kc2R+zQq/2pMV X-Received: by 10.84.200.39 with SMTP id s36mr78045pld.9.1510225484612; Thu, 09 Nov 2017 03:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510225484; cv=none; d=google.com; s=arc-20160816; b=zCD+ozY/3wV7H25/PM+TvX55pxRr4AFdoE3H9BhGr1ENEAHfjEkmTxateeML1sxycp MpUuMsD2fna07rao7E+cWNlBq/+/pBoU+z05mEHSBXDOEtowhx5m0AH6mQFFNuccoLzB QoN4zUyZVm9JSKelfZxfPzITo6+n+FEQy1wPq8Aqweh7kuzY0O8qJnaJ3AAAzia8B1Y8 CLo9MMvM+LrJZQHzQHFjKX99nnef3c7JVB8SCbl6YVYxXt/8w9sLoS4AhXTuQHJmcQ/I 7XZp9lDsPzVWw7A7M2aLlTP7qLB1U68bWP7wPdQBhzBLOy3nN7tZimTHiqGbOG1oR5n8 bkUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=pyq3zWP2bEPLHSJHxVg74PWTLmnYOG+cXSYmzzCMswg=; b=AgEzabpVKu6xTvyWiHCIDQ+EE2Xet00Nfwa23cnc9+pRGdQeCLqpcMBg++IK0L5FQq /MwN+cvo1AlRrAoyDZW6qiDR3p592r34eFX3+5F3edlB8+J/YWVYhXrRVETY3YLZmGiv qPEDD5zJ7lsTM9yBv6VotLmCCqPGFbVhAAh0iFqeQ4DU/t9FuMg1/9h8mpHgdPlCwX/X wnog9NW+JrxqBUOFG5C/qndZB/f2mB6YQptqWGmC1y919vW4YEuXJKjGrJvOM934ZRVE F5iiYFJUG0CJsJz0v/md8Isf75Z/mlp/NLZRoPNCnfNhWeEwBwr7H/SUv96VCvfVxNeB NzFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si6002492pli.734.2017.11.09.03.04.33; Thu, 09 Nov 2017 03:04:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbdKILDc (ORCPT + 81 others); Thu, 9 Nov 2017 06:03:32 -0500 Received: from 19pmail.ess.barracuda.com ([64.235.150.244]:40110 "EHLO 19pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752595AbdKILDb (ORCPT ); Thu, 9 Nov 2017 06:03:31 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx28.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Thu, 09 Nov 2017 11:03:15 +0000 Received: from mredfearn-linux.mipstec.com (10.150.130.83) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 9 Nov 2017 03:03:15 -0800 From: Matt Redfearn To: Marc Zyngier , Thomas Gleixner CC: , Matt Redfearn , Jason Cooper , Subject: [PATCH 2/2] irqchip: mips-gic: Print warning if inherited GIC base is used Date: Thu, 9 Nov 2017 11:02:45 +0000 Message-ID: <1510225365-2584-2-git-send-email-matt.redfearn@mips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510225365-2584-1-git-send-email-matt.redfearn@mips.com> References: <1510225365-2584-1-git-send-email-matt.redfearn@mips.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.150.130.83] X-BESS-ID: 1510225395-637138-27153-971504-1 X-BESS-VER: 2017.12-r1710252241 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.186750 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the physical address of the GIC resource cannot be read from device tree, then the code falls back to reading it from the gcr_gic_base register. Hopefully this has been set to a sane value by the bootloader or some platform code, but is defined by the hardware manual to have "undefined" reset state. Using it as the address at which the GIC will be mapped into physical memory space can therefore be risky if it has not been initialised, since it may result in the GIC being mapped to an effectively random address anywhere in physical memory, where it might conflict with peripherals or RAM and lead to weird crashes. Since a "sane value" is very platform specific because it is particular to the platform's memory map, it is difficult to test for. At the very least, a warning message should be printed in the case that we trust the inherited value. Reported-by: Amit Kama Signed-off-by: Matt Redfearn Reviewed-by: Paul Burton --- drivers/irqchip/irq-mips-gic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 9b768899f07b..ef92a4d2038e 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -701,6 +701,8 @@ static int __init gic_of_init(struct device_node *node, gic_base = read_gcr_gic_base() & ~CM_GCR_GIC_BASE_GICEN; gic_len = 0x20000; + pr_warn("Using inherited base address %pa\n", + &gic_base); } else { pr_err("Failed to get memory range\n"); return -ENODEV; -- 2.7.4 From 1583622329393172908@xxx Thu Nov 09 20:39:02 +0000 2017 X-GM-THRID: 1583622329393172908 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread