linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: kernel: improve error message when LPAE config doesn't match CPU
@ 2014-02-18 13:20 Thomas Petazzoni
  2014-02-18 14:31 ` Will Deacon
  2014-02-18 15:35 ` Russell King - ARM Linux
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2014-02-18 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

Currently, when the kernel is configured with LPAE support, but the
CPU doesn't support it, the error message is fairly cryptic:

  Error: unrecognized/unsupported processor variant (0x561f5811).

This messages is normally shown when there is an issue when comparing
the processor ID (CP15 0, c0, c0) with the values/masks described in
proc-v7.S. However, the same message is displayed when LPAE support is
enabled in the kernel configuration, but not available in the CPU,
after looking at ID_MMFR0 (CP15 0, c0, c1, 4). Having the same error
message is highly misleading.

This commit improves this by showing a different error message when
this situation occurs:

  Error: Kernel with LPAE support, but CPU does not support LPAE.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/kernel/head-common.S | 12 ++++++++++++
 arch/arm/kernel/head.S        |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 47cd974..c96ecac 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -177,6 +177,18 @@ __lookup_processor_type_data:
 	.long	__proc_info_end
 	.size	__lookup_processor_type_data, . - __lookup_processor_type_data
 
+__error_lpae:
+#ifdef CONFIG_DEBUG_LL
+	adr	r0, str_lpae
+	bl 	printascii
+	b	__error
+str_lpae: .asciz "\nError: Kernel with LPAE support, but CPU does not support LPAE.\n"
+#else
+	b	__error
+#endif
+	.align
+ENDPROC(__error_lpae)
+
 __error_p:
 #ifdef CONFIG_DEBUG_LL
 	adr	r0, str_p1
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 914616e..f5f381d 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -102,7 +102,7 @@ ENTRY(stext)
 	and	r3, r3, #0xf			@ extract VMSA support
 	cmp	r3, #5				@ long-descriptor translation table format?
  THUMB( it	lo )				@ force fixup-able long branch encoding
-	blo	__error_p			@ only classic page table format
+	blo	__error_lpae			@ only classic page table format
 #endif
 
 #ifndef CONFIG_XIP_KERNEL
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ARM: kernel: improve error message when LPAE config doesn't match CPU
  2014-02-18 13:20 [PATCH] ARM: kernel: improve error message when LPAE config doesn't match CPU Thomas Petazzoni
@ 2014-02-18 14:31 ` Will Deacon
  2014-02-18 15:35 ` Russell King - ARM Linux
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2014-02-18 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 18, 2014 at 01:20:18PM +0000, Thomas Petazzoni wrote:
> Currently, when the kernel is configured with LPAE support, but the
> CPU doesn't support it, the error message is fairly cryptic:
> 
>   Error: unrecognized/unsupported processor variant (0x561f5811).
> 
> This messages is normally shown when there is an issue when comparing
> the processor ID (CP15 0, c0, c0) with the values/masks described in
> proc-v7.S. However, the same message is displayed when LPAE support is
> enabled in the kernel configuration, but not available in the CPU,
> after looking at ID_MMFR0 (CP15 0, c0, c1, 4). Having the same error
> message is highly misleading.
> 
> This commit improves this by showing a different error message when
> this situation occurs:
> 
>   Error: Kernel with LPAE support, but CPU does not support LPAE.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Looks sensible enough to me:

  Acked-by: Will Deacon <will.deacon@arm.com>

Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ARM: kernel: improve error message when LPAE config doesn't match CPU
  2014-02-18 13:20 [PATCH] ARM: kernel: improve error message when LPAE config doesn't match CPU Thomas Petazzoni
  2014-02-18 14:31 ` Will Deacon
@ 2014-02-18 15:35 ` Russell King - ARM Linux
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2014-02-18 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 18, 2014 at 02:20:18PM +0100, Thomas Petazzoni wrote:
> Currently, when the kernel is configured with LPAE support, but the
> CPU doesn't support it, the error message is fairly cryptic:
> 
>   Error: unrecognized/unsupported processor variant (0x561f5811).
> 
> This messages is normally shown when there is an issue when comparing
> the processor ID (CP15 0, c0, c0) with the values/masks described in
> proc-v7.S. However, the same message is displayed when LPAE support is
> enabled in the kernel configuration, but not available in the CPU,
> after looking at ID_MMFR0 (CP15 0, c0, c1, 4). Having the same error
> message is highly misleading.
> 
> This commit improves this by showing a different error message when
> this situation occurs:
> 
>   Error: Kernel with LPAE support, but CPU does not support LPAE.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Nothing obviously wrong, please put it in the patch system, thanks.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-18 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-18 13:20 [PATCH] ARM: kernel: improve error message when LPAE config doesn't match CPU Thomas Petazzoni
2014-02-18 14:31 ` Will Deacon
2014-02-18 15:35 ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).