summaryrefslogtreecommitdiff
path: root/COPYING.BSD
diff options
context:
space:
mode:
authorEvgenii Shatokhin <e.shatokhin@yadro.com>2023-03-06 00:22:47 +0300
committerAnup Patel <anup@brainfault.org>2023-03-10 11:43:40 +0300
commitc6a092cd80112529cb2e92e180767ff5341b22a3 (patch)
tree3fe7ea041e7bc73f8f8e0df4f7648ba8f7a1cbbf /COPYING.BSD
parente8e9ed3790feac05ec6fd5c279ec80b05293d67b (diff)
downloadopensbi-master.tar.xz
Since commit 50d4fde1c5a4 ("lib: Remove redundant sbi_platform_ipi_clear() calls"), the IPI sent from the boot hart in wake_coldboot_harts() is not cleared in the secondary harts until they reach sbi_ipi_init(). However, sbi_hsm_init() and sbi_hsm_hart_wait() are called earlier, so a secondary hart might enter sbi_hsm_hart_wait() with an already pending IPI. sbi_hsm_hart_wait() makes sure the hart leaves the loop only when it is actually ready, so a pending unrelated IPI should not cause safety issues. However, it might be inefficient on certain hardware, because it prevents "wfi" from stalling the hart even if the hardware supports this, making the hart needlessly spin in a "busy-wait" loop. This behaviour can be observed, for example, in a QEMU VM (QEMU 7.2.0) with "-machine virt" running a Linux guest. Inserting delays in sbi_hsm_hart_start() allows reproducing the issue more reliably. The comment in wait_for_coldboot() suggests that the initial IPI is needed in the warm resume path, so let us clear it before init_warm_startup() only. To do this, sbi_ipi_raw_clear() was created similar to sbi_ipi_raw_send(). Signed-off-by: Evgenii Shatokhin <e.shatokhin@yadro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'COPYING.BSD')
0 files changed, 0 insertions, 0 deletions