mirror of https://github.com/wolfSSL/wolfBoot.git
sbi_ipi_irq() read-and-cleared the per-hart op word before executing the requested fence.i/sfence.vma, and sbi_wait_ipi_done() treated a zero op word as completion. The SBI remote-fence ecalls are synchronous, so a requester could return while the target had not yet run its fence (e.g. resume relying on a new page table before the target flushed its TLB). Split the protocol into pending work and completion state, per hart: ipi_done[h] is incremented by the target only after it has executed the fence ops it consumed; the requester snapshots it into ipi_wait_gen[h] before posting (so a concurrent coalesced consume of two requesters' ops still increments past both snapshots) and waits until ipi_done[h] passes the snapshot. SSIP posts are fire-and-forget and do not wait, as before. Verification: - Built: riscv-none-elf-gcc 15.2 -fsyntax-only -Wall with WOLFBOOT_RISCV_MMODE + WOLFBOOT_MMODE_SMODE_BOOT: clean. - Tested: none (race condition; the contract skips failing-first tests for races, and the file is MPFS S-mode monitor code with no host or CI build target). - Pitfalls: the shared DTIM struct gains two per-hart arrays; the struct is self-initialized under init_magic by this same code on every hart, so no cross-version ABI is broken. A target that never runs M-soft still hits the bounded spin timeout as before. The completion increment covers only fence ops, matching the only waiting call sites (both RFENCE paths). - Style: cstyle-check.sh flag count unchanged from the pre-change file (3 pre-existing). - Message: F-11029: prefix, no co-author trailers. - Unverified: no multi-hart runtime execution (MPFS board only). |
||
|---|---|---|
| .. | ||
| dice | ||
| x86 | ||
| arm_tee_psa_ipc.c | ||
| arm_tee_psa_veneer.c | ||
| boot_aarch64.c | ||
| boot_aarch64_efi.c | ||
| boot_aarch64_start.S | ||
| boot_arm.c | ||
| boot_arm32.c | ||
| boot_arm32_start.S | ||
| boot_c2000.c | ||
| boot_ppc.c | ||
| boot_ppc_mp.S | ||
| boot_ppc_start.S | ||
| boot_renesas.c | ||
| boot_renesas_start.S | ||
| boot_riscv.c | ||
| boot_riscv_start.S | ||
| boot_x86_64.c | ||
| boot_x86_fsp.c | ||
| boot_x86_fsp_payload.c | ||
| boot_x86_fsp_start.S | ||
| clang_sections.S | ||
| ddr_cadence.c | ||
| delta.c | ||
| disk.c | ||
| elf.c | ||
| fdt.c | ||
| flash_otp_keystore.c | ||
| fwtpm_callable.c | ||
| gpt.c | ||
| gzip.c | ||
| image.c | ||
| libwolfboot.c | ||
| loader.c | ||
| multiboot.c | ||
| pci.c | ||
| pkcs11_callable.c | ||
| pkcs11_store.c | ||
| psa_store.c | ||
| qspi_flash.c | ||
| riscv_sbi.c | ||
| sdhci.c | ||
| spi_flash.c | ||
| stage2_params.c | ||
| store_sbrk.c | ||
| store_sbrk.h | ||
| string.c | ||
| tpm.c | ||
| uart_flash.c | ||
| ubootenv.c | ||
| update_disk.c | ||
| update_flash.c | ||
| update_flash_hwswap.c | ||
| update_ram.c | ||
| vector_riscv.S | ||
| wc_callable.c | ||
| wolfhsm_callable.c | ||
| wolfhsm_flash_hal.c | ||
| xmalloc.c | ||