Currently, all non-coldboot HARTs busy spin in wait_for_coldboot()
until the entire coldboot init sequence is completed.
This means:
1) On QEMU, all non-coldboot HARTs will eat host CPU time and
also slow down the coldboot HART until the entire coldboot
init sequence is completed.
2) On real HW, all non-coldboot HARTs will consume more CPU
power until the entire coldboot init sequence is completed.
To address this, wake up all non-coldboot HARTs as early as
possible in the coldboot init sequence.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
if (rc)
sbi_hart_hang();
+ /*
+ * All non-coldboot HARTs do HSM initialization (i.e. enter HSM state
+ * machine) at the start of the warmboot path so it is wasteful to
+ * have these HARTs busy spin in wait_for_coldboot() until coldboot
+ * path is completed.
+ */
+ wake_coldboot_harts(scratch, hartid);
+
rc = sbi_platform_early_init(plat, true);
if (rc)
sbi_hart_hang();
sbi_hart_hang();
}
- wake_coldboot_harts(scratch, hartid);
-
count = sbi_scratch_offset_ptr(scratch, init_count_offset);
(*count)++;
count = sbi_scratch_offset_ptr(scratch, entry_count_offset);
(*count)++;
+ /* Note: This has to be first thing in warmboot init sequence */
rc = sbi_hsm_init(scratch, hartid, false);
if (rc)
sbi_hart_hang();