opensbi/include/sbi
Anup Patel beb0cd177f lib: sbi: Simplify wait_for_coldboot() implementation
On QEMU virt machine with large number of HARTs, some of the HARTs
randomly fail to come out of wait_for_coldboot() due to one of the
following race-conditions:

1) Failing HARTs are not able to acquire the coldboot_lock and
   update the coldboot_hartmask in wait_for_coldboot() before
   the coldboot HART acquires the coldboot_lock and sends IPI
   in wake_coldboot_harts() hence the failing HARTs never
   receive IPI from the coldboot HART.

2) Failing HARTs acquire the coldbood_lock and update the
   coldboot_hartmask before coldboot HART does sbi_scratch_init()
   so the sbi_hartmask_set_hartid() does not update the
   coldboot_hartmask on the failing HARTs hence they never
   receive IPI from the coldboot HART.

To address this, use a simple busy-loop in wait_for_coldboot() for
polling on coldboot_done flag.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
2024-04-05 17:48:23 +05:30
..
fw_dynamic.h include: Use static asserts for FW_DYNAMIC_INFO_xxx_OFFSET defines 2022-03-27 09:44:58 +05:30
riscv_asm.h lib: sbi: Add functions to manipulate PMP entries 2023-07-13 12:10:39 +05:30
riscv_atomic.h lib: sbi: Fix __atomic_op_bit_ord and comments 2023-12-08 13:47:31 +05:30
riscv_barrier.h lib: sbi: Simplify wait_for_coldboot() implementation 2024-04-05 17:48:23 +05:30
riscv_dbtr.h include: sbi: Introduce debug trigger register encodings 2024-01-10 09:43:34 +05:30
riscv_elf.h firmware: Remove handling of R_RISCV_{32,64} 2023-10-06 09:21:23 +05:30
riscv_encoding.h lib: sbi: Remove regs parameter from trap irq handling functions 2024-03-19 11:31:35 +05:30
riscv_fp.h lib: sbi: Implement SET_FS_DIRTY() to make sure the mstatus FS dirty is set 2023-09-22 11:17:26 +05:30
riscv_io.h all: run clang-format and update checked-in files 2019-04-24 09:49:46 +05:30
riscv_locks.h lib: sbi: Have spinlock checks return bool 2021-05-14 17:05:20 +05:30
sbi_bitmap.h platform: generic: Add support for specify coldboot harts in DT 2024-02-20 15:49:36 +05:30
sbi_bitops.h platform: recalculate heap size to support new tlb entry number 2023-12-11 09:23:24 +05:30
sbi_byteorder.h include: sbi: Support byteorder macros in assembly 2024-04-05 17:23:51 +05:30
sbi_console.h lib: sbi: Add console_puts() callback in the console device 2023-02-10 10:04:41 +05:30
sbi_const.h include: headers: Replace __ASSEMBLY__ with __ASSEMBLER__ 2021-03-22 16:02:48 +05:30
sbi_cppc.h lib: sbi: Implement SBI CPPC extension 2023-04-07 09:36:01 +05:30
sbi_csr_detect.h lib: fix csr detect support 2021-04-05 13:43:08 +05:30
sbi_dbtr.h lib: sbi: Introduce the SBI debug triggers extension support 2024-01-10 10:55:42 +05:30
sbi_domain.h lib: sbi: Add initial domain context management support 2024-03-10 10:26:42 +05:30
sbi_domain_context.h lib: sbi: Add initial domain context management support 2024-03-10 10:26:42 +05:30
sbi_ecall.h lib: sbi: Pass trap context pointer to sbi_ecall_handler() 2024-03-19 11:31:39 +05:30
sbi_ecall_interface.h lib: sbi: Add support for Supervisor Software Events extension 2024-04-05 15:47:30 +05:30
sbi_emulate_csr.h lib: sbi_emulate_csr: Remove scratch and hartid parameter 2020-03-28 13:32:07 +05:30
sbi_error.h lib: sbi: Add support for Supervisor Software Events extension 2024-04-05 15:47:30 +05:30
sbi_fifo.h lib: sbi: Checking fifo validness in sbi_fifo_is_empty and is_full 2021-09-03 11:59:35 +05:30
sbi_hart.h lib: sbi: Add support for smcsrind and smcdeleg 2024-03-04 10:20:41 +05:30
sbi_hartmask.h include: sbi: Remove sbi_hartmask_for_each_hart() macro 2023-09-24 11:48:21 +05:30
sbi_heap.h platform: recalculate heap size to support new tlb entry number 2023-12-11 09:23:24 +05:30
sbi_hfence.h lib: sbi: Fix GPA passed to __sbi_hfence_gvma_xyz() functions 2021-11-02 16:02:08 +05:30
sbi_hsm.h lib: sbi: Refactor the calls to sbi_hart_switch_mode() 2023-03-10 14:00:36 +05:30
sbi_illegal_insn.h lib: sbi: Simplify parameters of sbi_illegal_insn_handler() 2024-03-19 11:31:31 +05:30
sbi_init.h lib: sbi: Introduce sbi_entry_count() function 2023-04-06 18:48:15 +05:30
sbi_ipi.h lib: sbi: Prefer hartindex over hartid in IPI framework 2023-09-24 11:39:38 +05:30
sbi_irqchip.h lib: sbi: Remove regs paramter of sbi_irqchip_process() 2024-03-19 11:31:33 +05:30
sbi_list.h lib: sbi: Remove unnecessary semicolon 2023-05-11 12:31:34 +05:30
sbi_math.h lib: Create a separate math helper function file 2020-05-10 09:59:24 +05:30
sbi_platform.h lib: sbi: call platform load/store emulators 2024-03-11 10:56:02 +05:30
sbi_pmu.h lib: sbi: Add SSE support for PMU events 2024-04-05 17:09:39 +05:30
sbi_scratch.h include: sbi: Add trap_context pointer in struct sbi_scratch 2024-03-19 11:31:20 +05:30
sbi_sse.h lib: sbi: Add support for Supervisor Software Events extension 2024-04-05 15:47:30 +05:30
sbi_string.h lib: Add sbi_strncmp implementation 2020-07-29 12:03:45 +05:30
sbi_system.h lib: sbi: Align system suspend errors with spec 2023-06-04 15:18:40 +05:30
sbi_timer.h lib: sbi_timer: Added a conditional wait function which can timeout 2022-07-08 14:51:24 +05:30
sbi_tlb.h lib: sbi_tlb: Reduce size of struct sbi_tlb_info 2023-12-19 15:56:37 +05:30
sbi_trap.h lib: sbi: Introduce trap context 2024-03-19 11:31:22 +05:30
sbi_trap_ldst.h lib: sbi: Simplify parameters of misaligned and access fault handlers 2024-03-19 11:31:28 +05:30
sbi_types.h include: types: Add typedefs for endianness 2023-02-08 18:24:13 +05:30
sbi_unit_test.h lib: Add SBIUnit testing macros and functions 2024-03-10 10:05:28 +05:30
sbi_unpriv.h lib: Remove scratch parameter from unpriv load/store functions 2020-03-28 13:32:01 +05:30
sbi_version.h include: Bump-up version to 1.4 2023-12-27 12:32:58 +05:30