Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603453

[PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From afzal mohammed <afzal.mohd.ma@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme
Date Fri, 17 Mar 2017 17:50:01 +0100
Message-ID <tm3eF-UG-7@gated-at.bofh.it> (permalink)
X-Original-To Russell King - ARM Linux <linux@armlinux.org.uk>
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=pPaHyE+Il51By7lVrwWGmnO1DTysGdnpjp38X3um0II5/z7C2PKqwYUy4yPNaRFIXv pcWZ/6tNfqN4v6g2pNa7IjDD2oYaUwqDTRQlJm+GsEOeZNo0n6qkUFoB+wDDHIZEAJpw 0B+isL4P3lwVgeMhTietph8MFk6UwfbzhNIhvbjRj+txI3zZemcGC+JuGsIRzq1m+S7N y5/oEtIKh661ElKzPQIbhvI/BP1uuP6Tdo+1iYYHU7Iba2WCkDIusvZWldVE1ZMx03e2 A15GIBW9AsO8eSOKp9khrRVVCghti9+KBxWmI25PiThjpeNgelJi8xl8jDQ/yLK3fgd+ cVZA==
X-Gm-Message-State AFeK/H0U9I25UBNanJTEvlAF2kmgT5LGQgycjR702OkOYAWsIH2GdPSPoUrQN+8bHQwW2A==
X-Received by 10.98.75.28 with SMTP id y28mr18309942pfa.157.1489768850913; Fri, 17 Mar 2017 09:40:50 -0700 (PDT)
X-Mailer git-send-email 2.12.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 48
Organization linux.* mail to news gateway
X-Original-Cc Greg Ungerer <gerg@uclinux.org>, Vladimir Murzin <vladimir.murzin@arm.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, afzal mohammed <afzal.mohd.ma@gmail.com>
X-Original-Date Fri, 17 Mar 2017 22:10:34 +0530
X-Original-Message-ID <20170317164034.4036-1-afzal.mohd.ma@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1603453

Show key headers only | View raw


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 <gerg@uclinux.org>
Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com>
---

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)
-- 
2.12.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme afzal mohammed <afzal.mohd.ma@gmail.com> - 2017-03-17 17:50 +0100
  Re: [PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme afzal mohammed <afzal.mohd.ma@gmail.com> - 2017-03-23 11:50 +0100
    Re: [PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme Greg Ungerer <gerg@uclinux.org> - 2017-03-23 12:50 +0100
      Re: [PATCH] ARM: nommu: access ID_PFR1 only if CPUID scheme afzal mohammed <afzal.mohd.ma@gmail.com> - 2017-03-23 14:00 +0100

csiph-web