From b9f1eb29e9c84aa3cb0b75ab3ced144f019e4dff Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sun, 3 Oct 2021 00:28:08 +0900 Subject: [PATCH] kboot: Only try to parse actual CPUs in /cpus Signed-off-by: Hector Martin --- src/kboot.c | 4 ++++ src/payload.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kboot.c b/src/kboot.c index 49b44911..00da0ef8 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -206,6 +206,10 @@ static int dt_set_cpus(void) int node, cpu = 0; fdt_for_each_subnode(node, dt, cpus) { + const char *name = fdt_get_name(dt, node, NULL); + if (strncmp(name, "cpu@", 4)) + continue; + const fdt64_t *prop = fdt_getprop(dt, node, "reg", NULL); if (!prop) bail("FDT: failed to get reg property of CPU\n"); diff --git a/src/payload.c b/src/payload.c index 7b024912..96759c09 100644 --- a/src/payload.c +++ b/src/payload.c @@ -177,7 +177,7 @@ int payload_run(void) smp_start_secondaries(); if (kboot_prepare_dt(fdt)) { - printf("Failed to prepare FDT!"); + printf("Failed to prepare FDT!\n"); return -1; }