Skip to content

Commit b363457

Browse files
tpetazzoniRussell King
authored andcommitted
ARM: 7980/1: kernel: improve error message when LPAE config doesn't match CPU
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> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent c9698e5 commit b363457

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎arch/arm/kernel/head-common.S‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ __lookup_processor_type_data:
177177
.long __proc_info_end
178178
.size __lookup_processor_type_data, . - __lookup_processor_type_data
179179

180+
__error_lpae:
181+
#ifdef CONFIG_DEBUG_LL
182+
adr r0, str_lpae
183+
bl printascii
184+
b __error
185+
str_lpae: .asciz "\nError: Kernel with LPAE support, but CPU does not support LPAE.\n"
186+
#else
187+
b __error
188+
#endif
189+
.align
190+
ENDPROC(__error_lpae)
191+
180192
__error_p:
181193
#ifdef CONFIG_DEBUG_LL
182194
adr r0, str_p1

‎arch/arm/kernel/head.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ENTRY(stext)
102102
and r3, r3, #0xf @ extract VMSA support
103103
cmp r3, #5 @ long-descriptor translation table format?
104104
THUMB( it lo ) @ force fixup-able long branch encoding
105-
blo __error_p @ only classic page table format
105+
blo __error_lpae @ only classic page table format
106106
#endif
107107

108108
#ifndef CONFIG_XIP_KERNEL

0 commit comments

Comments
 (0)