From patchwork Fri Mar 17 16:40:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: afzal mohammed X-Patchwork-Id: 9631055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF400602D6 for ; Fri, 17 Mar 2017 16:41:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8825286E3 for ; Fri, 17 Mar 2017 16:41:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD688286E7; Fri, 17 Mar 2017 16:41:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57424286E3 for ; Fri, 17 Mar 2017 16:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=zcsTBCcKXAA2IB2t/hwUpo+rIsj6SR4XNGObjs+8OFw=; b=HpV GfVd2Ie6SvGmAREhMCHv/99PUj8KhADFwbyjiXognIzXtcrwi1rV6fmfzvh+Y2b7QPLelZekg0p97 78AKUNt0pxJ4hsBFWg7M5s+ZsqPd1kz6a5pEMjs4I5PeXtFiME756fgsZTzHJljPEBfzSUjI06MdV F5KpA64w04jVVBbe5DSNLBOeWnzZhm9oI6ASVIFspzrflvTjOkjvwTvQkp03/CmXq+/Q2xYJAjxwX eE+UmRLbMlYVzE+QWTdM5zaFD8oUf6HMepeTgdP2aNw5KSI2zfrxyStfL6HFE8Px7UX0xQgwW7BUZ KBHLNR0HktL8DACh5Uy6NlKkMmjCnJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1couwG-0001TC-1A; Fri, 17 Mar 2017 16:41:16 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1couwC-0001QU-A0 for linux-arm-kernel@lists.infradead.org; Fri, 17 Mar 2017 16:41:14 +0000 Received: by mail-pg0-x244.google.com with SMTP id 81so2618311pgh.3 for ; Fri, 17 Mar 2017 09:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KqQKTcRXjKnYSCri/QAfPVA1Viib8mJOq3oczoFWMv0=; b=Aw/6OXddU55XCAuKrTVzM103yZ7IzZIYzcs8SHEoKmky8RWOPhz8HlsI+qqhBA93BY jCb5EKSi2Ad/O9CpYp+wduVrypj/mHUtFFW4PfCz5yVT7/GwHx/hJc+IA2xvzlkT4VRI 4nV6rognbfbAtXluq0OuQBAH7SqaqhkgW8TsmK64QDmi+cIw6CdG8b8Zh0ljEuyB/Smm uUghV+p0iiR+yIUzjovwFaA4C/hriGXHb3sCBFgQ9/bznBBvHnDDTJYZl5sW3MTYqlK2 E32MOjdPbr8cJn8wPejzHkHsXRaAZBx/SI/jQ1Phz1ZW390+Fwq/xMeP/xZj1hpZJOc4 qx6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KqQKTcRXjKnYSCri/QAfPVA1Viib8mJOq3oczoFWMv0=; b=gPXSBZ4Xz4kIvdTHTUOWiIdRmOnbOgA3PV8bc8lWmFaJG8T2iW2pm9wiu1D5W4WNId age631cOQk3FcfpXKQBTc/KuqyqtLUnLV3T0aaa8c8kVdpOZR2TKqXAV1U0km+lFyF9q PR9/YFLN3FOD0/tKc6FX5SmMYMEEFVAGikygSB4LDML1M5dUnDwIAmQ0heLdztNorDvn ll1dS6u86wIs1pbOQb4IleWuYmUekyBc5WWPKPaI1MNMN8YZ4+3RM3aheppg5TKCPX9R lRlMrB82FKmAefuyN3sPk4YKcPfcN90q9Ou8CJfm+ymHIcXpQE6RxCqEna2Vott77MCs HkTQ== X-Gm-Message-State: AFeK/H0aHYQhgFp/pCdW9853o3EiGTtilA0uJAy7Mhs3rffBaNlFR9cj+I6Dng2m3n/hkQ== X-Received: by 10.98.75.28 with SMTP id y28mr18309942pfa.157.1489768850913; Fri, 17 Mar 2017 09:40:50 -0700 (PDT) Received: from localhost.localdomain ([49.203.205.64]) by smtp.gmail.com with ESMTPSA id i26sm12045480pfi.129.2017.03.17.09.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Mar 2017 09:40:50 -0700 (PDT) From: afzal mohammed To: Russell King - ARM Linux Subject: [PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme Date: Fri, 17 Mar 2017 22:10:34 +0530 Message-Id: <20170317164034.4036-1-afzal.mohd.ma@gmail.com> X-Mailer: git-send-email 2.12.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170317_094112_384299_0D1B3A4F X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Murzin , afzal mohammed , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Greg Ungerer MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Greg upon trying to boot no-MMU Kernel on ARM926EJ reported boot failure. He root caused it to ID_PFR1 access introduced by the commit mentioned in the fixes tag below. All CP15 processors need not have processor feature registers, only for architectures defined by CPUID scheme would have it. Hence check for it before accessing processor feature register, ID_PFR1. Fixes: f8300a0b5de0 ("ARM: 8647/2: nommu: dynamic exception base address setting") Reported-by: Greg Ungerer Signed-off-by: afzal mohammed Tested-by: Greg Ungerer --- Hi Russell, It would be good to have the fix go in during -rc, as, 1. Culprit commit went in during the last merge window 2. Though nothing supported in mainline is known to be broken, the original change needs to be modified to be reliable Vladimir, this is being posted as the issue is taken care run time. Regards afzal --- arch/arm/mm/nommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index 3b5c7aaf9c76..33a45bd96860 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c @@ -303,7 +303,10 @@ static inline void set_vbar(unsigned long val) */ static inline bool security_extensions_enabled(void) { - return !!cpuid_feature_extract(CPUID_EXT_PFR1, 4); + /* Check CPUID Identification Scheme before ID_PFR1 read */ + if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) + return !!cpuid_feature_extract(CPUID_EXT_PFR1, 4); + return 0; } static unsigned long __init setup_vectors_base(void)