Skip to content

Commit 83a39ec

Browse files
Bartosz Szczepanekwilldeacon
authored andcommitted
arm64: Extend pr_crit message on invalid FDT
Log size in addition to physical and virtual addresses. It has potential to be helpful when DTB exceeds the 2 MB limit. Initialize size to 0 to print out sane value if fixmap_remap_fdt fails without setting the size. Signed-off-by: Bartosz Szczepanek <bsz@amazon.de> Link: https://lore.kernel.org/r/20250423084851.26449-1-bsz@amazon.de Signed-off-by: Will Deacon <will@kernel.org>
1 parent e2eaeba commit 83a39ec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/arm64/kernel/setup.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void __init smp_build_mpidr_hash(void)
169169

170170
static void __init setup_machine_fdt(phys_addr_t dt_phys)
171171
{
172-
int size;
172+
int size = 0;
173173
void *dt_virt = fixmap_remap_fdt(dt_phys, &size, PAGE_KERNEL);
174174
const char *name;
175175

@@ -182,10 +182,10 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
182182
*/
183183
if (!early_init_dt_scan(dt_virt, dt_phys)) {
184184
pr_crit("\n"
185-
"Error: invalid device tree blob at physical address %pa (virtual address 0x%px)\n"
186-
"The dtb must be 8-byte aligned and must not exceed 2 MB in size\n"
187-
"\nPlease check your bootloader.",
188-
&dt_phys, dt_virt);
185+
"Error: invalid device tree blob: PA=%pa, VA=%px, size=%d bytes\n"
186+
"The dtb must be 8-byte aligned and must not exceed 2 MB in size.\n"
187+
"\nPlease check your bootloader.\n",
188+
&dt_phys, dt_virt, size);
189189

190190
/*
191191
* Note that in this _really_ early stage we cannot even BUG()

0 commit comments

Comments
 (0)