All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Rajendra Nayak <rnayak@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH v2] ARM: v6: avoid remaining accesses to missing CP15 registers on ARM1136 r0
Date: Sun, 28 Jul 2013 06:00:26 +0000 (UTC)	[thread overview]
Message-ID: <alpine.DEB.2.02.1307280559330.8385@utopia.booyaka.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1307280543370.8385@utopia.booyaka.com>

Ensure that the remaining callers of read_cpuid_ext can't attempt an 
extended CP15 register read on ARMv6 cores that don't support it.  The 
only one that appears dodgy is tlb_ops_need_broadcast().

While here, convert feat_v6_fixup() to use cpu_is_arm1136_r0() to save
a few lines of code.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/include/asm/smp_plat.h | 3 +++
 arch/arm/kernel/setup.c         | 7 +------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
index 76214cb..ad07564 100644
--- a/arch/arm/include/asm/smp_plat.h
+++ b/arch/arm/include/asm/smp_plat.h
@@ -30,6 +30,9 @@ static inline bool is_smp(void)
 #else
 static inline int tlb_ops_need_broadcast(void)
 {
+	if (cpu_is_arm1136_r0())
+		return 0;
+
 	if (!is_smp())
 		return 0;
 
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 63af9a7..a601843 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -389,16 +389,11 @@ static void __init cpuid_init_hwcaps(void)
 
 static void __init feat_v6_fixup(void)
 {
-	int id = read_cpuid_id();
-
-	if ((id & 0xff0f0000) != 0x41070000)
-		return;
-
 	/*
 	 * HWCAP_TLS is available only on 1136 r1p0 and later,
 	 * see also kuser_get_tls_init.
 	 */
-	if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0))
+	if (cpu_is_arm1136_r0())
 		elf_hwcap &= ~HWCAP_TLS;
 }
 
-- 
1.8.3.2


WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: v6: avoid remaining accesses to missing CP15 registers on ARM1136 r0
Date: Sun, 28 Jul 2013 06:00:26 +0000 (UTC)	[thread overview]
Message-ID: <alpine.DEB.2.02.1307280559330.8385@utopia.booyaka.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1307280543370.8385@utopia.booyaka.com>

Ensure that the remaining callers of read_cpuid_ext can't attempt an 
extended CP15 register read on ARMv6 cores that don't support it.  The 
only one that appears dodgy is tlb_ops_need_broadcast().

While here, convert feat_v6_fixup() to use cpu_is_arm1136_r0() to save
a few lines of code.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/include/asm/smp_plat.h | 3 +++
 arch/arm/kernel/setup.c         | 7 +------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
index 76214cb..ad07564 100644
--- a/arch/arm/include/asm/smp_plat.h
+++ b/arch/arm/include/asm/smp_plat.h
@@ -30,6 +30,9 @@ static inline bool is_smp(void)
 #else
 static inline int tlb_ops_need_broadcast(void)
 {
+	if (cpu_is_arm1136_r0())
+		return 0;
+
 	if (!is_smp())
 		return 0;
 
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 63af9a7..a601843 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -389,16 +389,11 @@ static void __init cpuid_init_hwcaps(void)
 
 static void __init feat_v6_fixup(void)
 {
-	int id = read_cpuid_id();
-
-	if ((id & 0xff0f0000) != 0x41070000)
-		return;
-
 	/*
 	 * HWCAP_TLS is available only on 1136 r1p0 and later,
 	 * see also kuser_get_tls_init.
 	 */
-	if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0))
+	if (cpu_is_arm1136_r0())
 		elf_hwcap &= ~HWCAP_TLS;
 }
 
-- 
1.8.3.2

  parent reply	other threads:[~2013-07-28  6:00 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 18:07 OMAP2430 SDP boot broken after Linus' rmk merge Paul Walmsley
2013-07-22 18:07 ` Paul Walmsley
2013-07-22 18:43 ` Russell King - ARM Linux
2013-07-22 18:43   ` Russell King - ARM Linux
2013-07-22 20:07   ` Paul Walmsley
2013-07-22 20:07     ` Paul Walmsley
2013-07-23  7:03     ` Rajendra Nayak
2013-07-23  7:03       ` Rajendra Nayak
2013-07-23  7:07       ` Paul Walmsley
2013-07-23  7:07         ` Paul Walmsley
2013-07-23  9:05         ` Rajendra Nayak
2013-07-23  9:05           ` Rajendra Nayak
2013-07-24 13:56           ` Will Deacon
2013-07-24 13:56             ` Will Deacon
2013-07-24 14:17             ` Santosh Shilimkar
2013-07-24 14:17               ` Santosh Shilimkar
2013-07-24 14:20               ` Will Deacon
2013-07-24 14:20                 ` Will Deacon
2013-07-24 14:45                 ` Santosh Shilimkar
2013-07-24 14:45                   ` Santosh Shilimkar
2013-07-27  4:10                 ` Paul Walmsley
2013-07-27  4:10                   ` Paul Walmsley
2013-07-27 12:22                   ` Will Deacon
2013-07-27 12:22                     ` Will Deacon
2013-07-28  5:38                     ` Paul Walmsley
2013-07-28  5:38                       ` Paul Walmsley
2013-07-28  5:46                       ` [PATCH] ARM: v6: avoid remaining accesses to missing CP15 registers on ARM1136 r0 Paul Walmsley
2013-07-28  5:46                         ` Paul Walmsley
2013-07-28  5:58                         ` Paul Walmsley
2013-07-28  5:58                           ` Paul Walmsley
2013-07-28  6:00                         ` Paul Walmsley [this message]
2013-07-28  6:00                           ` [PATCH v2] " Paul Walmsley
2013-07-28 19:58                           ` Paul Walmsley
2013-07-28 19:58                             ` Paul Walmsley
2013-07-28  5:43                     ` [PATCH] ARM: v6: avoid read_cpuid_ext() on ARM1136r0 in cache_ops_need_broadcast() Paul Walmsley
2013-07-28  5:43                       ` Paul Walmsley
2013-07-28 11:10                       ` Will Deacon
2013-07-28 11:10                         ` Will Deacon
2013-07-28 11:52                         ` Russell King - ARM Linux
2013-07-28 11:52                           ` Russell King - ARM Linux
2013-07-28 19:56                           ` Paul Walmsley
2013-07-28 19:56                             ` Paul Walmsley
2013-07-28 19:47                         ` Paul Walmsley
2013-07-28 19:47                           ` Paul Walmsley
2013-07-28 20:16                       ` [PATCH] ARM: v6: prevent gcc from reordering extended CP15 reads above is_smp() test Paul Walmsley
2013-07-28 20:16                         ` Paul Walmsley
2013-07-29  7:30                         ` Tony Lindgren
2013-07-29  7:30                           ` Tony Lindgren
2013-07-29 10:02                         ` Will Deacon
2013-07-29 10:02                           ` Will Deacon
2013-07-30 10:58                           ` Paul Walmsley
2013-07-30 10:58                             ` Paul Walmsley
2013-07-30 11:32                         ` [PATCH v2] ARM: v6: prevent gcc 4.5 " Paul Walmsley
2013-07-30 11:32                           ` Paul Walmsley
2013-07-30 15:04                           ` Will Deacon
2013-07-30 15:04                             ` Will Deacon
2013-07-24 14:52               ` OMAP2430 SDP boot broken after Linus' rmk merge Russell King - ARM Linux
2013-07-24 14:52                 ` Russell King - ARM Linux
2013-07-24 15:40                 ` OMAP4430 SDP boot issues.. (Was Re: OMAP2430 SDP boot broken after Linus' rmk merge) Santosh Shilimkar
2013-07-24 15:40                   ` Santosh Shilimkar
2013-07-24 17:23                   ` Russell King - ARM Linux
2013-07-24 17:23                     ` Russell King - ARM Linux
2013-07-24 18:17                     ` Santosh Shilimkar
2013-07-24 18:17                       ` Santosh Shilimkar
2013-07-25  6:40                 ` OMAP2430 SDP boot broken after Linus' rmk merge Tomi Valkeinen
2013-07-25  6:40                   ` Tomi Valkeinen
2013-07-25  6:50                   ` Tomi Valkeinen
2013-07-25  6:50                     ` Tomi Valkeinen
2013-07-26 22:59                     ` Russell King - ARM Linux
2013-07-26 22:59                       ` Russell King - ARM Linux
2013-08-07 18:09           ` Paul Walmsley
2013-08-07 18:09             ` Paul Walmsley
2013-08-08  5:37             ` Rajendra Nayak
2013-08-08  5:37               ` Rajendra Nayak
2013-08-08 10:20               ` Rajendra Nayak
2013-08-08 10:20                 ` Rajendra Nayak
2013-07-23 10:33 ` Jonathan Austin
2013-07-23 10:33   ` Jonathan Austin
2013-07-31  0:57   ` Paul Walmsley
2013-07-31  0:57     ` Paul Walmsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1307280559330.8385@utopia.booyaka.com \
    --to=paul@pwsan.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rnayak@ti.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.