aboutsummaryrefslogtreecommitdiff
path: root/lib/sbi
AgeCommit message (Collapse)AuthorFilesLines
2024-07-24lib: sbi: Introduce an early console buffer for caching early printsAnup Patel2-1/+32
The console device is registered by platform only in early_init() callback so any prints before this point will be lost. Introduce an early console buffer for caching prints before platform early_init(). For crashes before platform early_init(), users can simply dump the contents of the console_early_buffer[] string using a debugger. The relative address of the console_early_buffer[] string can be found using following two commands: CONSOLE_EARLY_FIFO_ADDR=`${CROSS_COMPILE}objdump -D \ build/platform/generic/firmware/fw_dynamic.elf | \ grep "<console_early_fifo>:" | awk '{print $1}'` ${CROSS_COMPILE}objdump -R build/platform/generic/firmware/fw_dynamic.elf | \ grep $CONSOLE_EARLY_FIFO_ADDR | awk '{print $3}' Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-By: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-07-24lib: sbi: Allow forceful queueing of data in sbi_fifo_enqueue()Anup Patel3-30/+44
Extend sbi_fifo_enqueue() to allow forceful queueing by droping data from the tail. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-By: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-07-24lib: sbi: Optimize fifo enqueue/dequeue for basic data typesAnup Patel1-3/+40
Don't use sbi_memcpy() for basic data types in fifo enqueue/dequeue instead use direct type-cast and assignment. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-By: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-07-24lib: sbi: Remove sbi_console_init() and console_init() platform callbackAnup Patel2-15/+0
Now that all platforms have been updated to initialize serial console device in early_init(), the sbi_console_init() and console_init() platform callback are redundant hence remove them. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-By: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-07-24lib: sbi_hsm: Save/restore menvcfg only when it existsSamuel Holland1-4/+8
Attempting to access the menvcfg CSR raises an illegal instruction exception on hardware which implements Sm1p11 or older. Fixes: e9ee9678ba50 ("lib: sbi: fwft: add support for SBI_FWFT_PTE_AD_HW_UPDATING") Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-07-23lib: tests: add math test suiteDongdong Zhang2-0/+49
This patch introduces a new math test suite to the SBI unit tests. The changes include: * Updating lib/sbi/tests/objects.mk to include math_test_suite and sbi_math_test.o. * Adding a new file lib/sbi/tests/sbi_math_test.c which contains tests for log2roundup function using various cases. The addition of this test suite ensures that mathematical functions are verified and work as expected. Signed-off-by: Dongdong Zhang <zhangdongdong@eswincomputing.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-07-23lib: tests: enhance test output with colored pass/fail messagesDongdong Zhang1-2/+9
This patch improves the readability of the SBI unit test output by adding color-coded status messages. Adding ANSI color codes for green (pass) and red (fail) in sbi_unit_test.c. Now, the test results will be displayed in green for passed tests and red for failed tests, making it easier to quickly distinguish between them. Signed-off-by: Dongdong Zhang <zhangdongdong@eswincomputing.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-07-04Makefile: change to using .carray.c for carray filesBen Dooks2-2/+2
We would like to clean any files generated by the carray scripts by just searching for the filename as the current make system turns f.carray into f.o. Change to make the make system turn f.carray into f.carray.o note, command to go through .mk files changing the .o in the .mk files is: find . -type f -name "*.carray" | xargs -t -I fname /bin/bash -x -c ' fn=`basename -s .carray fname`; echo "$fn"; sed -i `dirname fname `/objects.mk -e s/"$fn".o/"$fn".carray.o/g' Link: https://patchwork.ozlabs.org/project/opensbi/patch/20240401213438.590209-2-ivan.orlov0322@gmail.com/ Reported-by: Ivan Orlov <ivan.orlov0322@gmail.com> Suggested-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-07-04lib: sbi_emulate_csr: Do not log illegal CSR accessesSamuel Holland1-9/+0
Illegal CSR accesses from lower privilege modes are delegated to S-mode and do not necessarily indicate a bug. Supervisor software may want to emulate some CSRs, or may intentionally disable access to certain existing CSRs, and thus will expect traps when those CSRs are accessed. For example, Linux disables sstatus.VS by default in order to detect when userspace first accesses vector register state; this includes the CSRs defined by the V extesion. As a result, if the first vector instruction in a process is a CSR access, OpenSBI will log the illegal instruction exception, even though there is no unexpected or erroneous behavior occurring. Since the illegal instruction exception is delegated to S-mode, S-mode software should be responsible for reporting the exception, not OpenSBI. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-28lib: sbi: check incoming dbtr shmem addressSergey Matyukevich1-6/+14
Current Debug Trigger SBI extension proposal suggests to activate shmem area and obtain its physical address from S-mode software in the following way: : If both `shmem_phys_lo` and `shmem_phys_hi` parameters are not : all-ones bitwise then `shmem_phys_lo` specifies the lower XLEN : bits and `shmem_phys_hi` specifies the upper XLEN bits of the : shared memory physical base address. The `shmem_phys_lo` MUST : be `(XLEN / 8)` byte aligned and the size of shared memory is : assumed to be `trig_max * (XLEN / 2)` bytes. For more details see the current version of the proposal: - https://lists.riscv.org/g/tech-debug/message/1302 On the other hand, on RV32, the M-mode can only access the first 4GB of the physical address space because M-mode does not have MMU to access full 34-bit physical address space. Similarly, on RV64, the M-mode can only access memory addressed by 64 bits. This commit checks shmem address in function sbi_dbtr_setup_shmem to make sure that shmem_phys_hi part of the valid address is zero. Besides, the macro DBTR_SHMEM_MAKE_PHYS is updated to take into account only low XLEN part. Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-06-26lib: sbi: fwft: return SBI_EINVAL rather than SBI_ERR_INVALID_PARAMClément Léger1-1/+1
Error code returned by the ecall handles should use the defines from sbi_ecall_interface.h rather than sbi_error.h. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-26lib: sbi: fwft: check feature value to be exactly 1 or 0Clément Léger1-4/+8
As stated by the spec and pointed out by Andrew Jones, the value passed for MISALIGNED_EXC_DELEG and PTE_AD_HW_UPDATING should be either 0 or 1. Add check for these values and return SBI_EINVAL if not. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-19lib: sbi: implement SBI FWFT extensionClément Léger3-0/+56
The SBI FWFT extension defines a set of function that can be called to control the configuration of some platform features (misaligned trap delegation, etc). This patch implements sbi_fwft_set() and sbi_fwft_get() as defined in the specification [1]. Link: https://lists.riscv.org/g/tech-prs/message/924 [1] Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-19lib: sbi: fwft: add support for SBI_FWFT_PTE_AD_HW_UPDATINGClément Léger2-0/+59
Add support for SBI_FWFT_PTE_AD_HW_UPDATING based on SVADU presence. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-19lib: sbi: fwft: add support for SBI_FWFT_MISALIGNED_EXC_DELEGClément Léger2-1/+41
Add support for SBI_FWFT_MISALIGNED_EXC_DELEG withing FWFT support. This support allows to delegate misaligned accesses traps. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-19lib: sbi: add support for firmware features extensionClément Léger3-0/+190
This extension allows the software running in supervisor mode to control the behavior of various features of the SBI [1]. Implement the support for such extension. Link: https://lists.riscv.org/g/tech-prs/message/924 [1] Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-18lib: sbi: Add support for Svade and Svadu extensionsYong-Xuan Wang1-0/+12
Add support for Svade and Svadu extensions. When both are present in the device tree, the M-mode firmware should select the Svade extension to comply with the RVA23 profile, which mandates Svade and lists Svadu as an optional extension. Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-06-13sbi: sbi_domain_context: Fix trap context for domain context switchingYu Chien Peter Lin1-5/+4
Save/restore sbi_trap_context during domain context switching to ensure proper trap handling and isolation. This maintains correct domain-specific state, avoiding context corruption. Fixes: abea949721bc ("lib: sbi: Introduce trap context") Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Tested-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yong Li <yong.li@intel.com> Tested-by: Yong Li <yong.li@intel.com>
2024-05-23lib: sbi: sse: handle missing writable attributesClément Léger1-19/+47
The spec states that a6, a7, flags and sepc are writable but the implementation was not allowing that. Add support for these 4 writable attributes. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-15lib: sbi: Put event after use in sbi_sse_exit() loopAnup Patel1-2/+7
Currently, the sbi_sse_exit() gets event in a loop but does not put it back after use. This results in global events remaining locked causing hangs on sub-sequent calls to sse_event_get() for global events. Fixes: c8cdf01d8f3a ("lib: sbi: Add support for Supervisor Software Events extension") Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-05-13lib: sbi: simplify inline function in sbi_dtbr.cXiang W1-46/+32
The inline function can simplify the code by setting some call restrictions. This ensures logical smoothness Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-13lib: sbi: fix return type of sbi_dbtr_shmem_disabledXiang W1-3/+3
Modify the return value of the sbi_dbtr_shmem_disabled function to bool to make the semantics clearer. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-13lib: sbi: Fixed memory permission check in sbi_dbtr_setup_shmemXiang W1-9/+3
The previous code detected shmem_phys_hi and shmem_phys_lo as two addresses. fix this bug Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-05-13lib: sbi: fix DBTR_SHMEM_MAKE_PHYS for RV64Xiang W1-1/+1
Obtaining a 64-bit address under rv64 does not require combining 32-bit registers Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-05-13lib: sbi: Removal unnecessary check dbtr_thishart_state_ptrXiang W1-2/+0
After getting hart_shmem_base, dbtr_thishart_state_ptr cannot be empty. So remove check code. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-05-13lib: sbi: fix hart_shmem_baseXiang W1-7/+4
When only phys_hi is equal to SBI_DBTR_SHMEM_INVALID_ADDR, it may be a legal address. The old code would modify the legal address. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
2024-05-07sbi: sbi_domain_context: Add spinlock for updating domain assigned_hartsAlvin Chang3-18/+52
Add spinlock protection to avoid race condition on assigned_harts during domain context switching. Also, rename/add variables for accessing the corresponding domain of target/current context. Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: Refine the settings for switching to Virtual Supervisor Mode.Pope B.Lei1-4/+11
Although Mstatus.MPV is set, before executing mret, access to VS mode registers should use the actual register addresses, not the pseudonyms of S registers. Signed-off-by: Pope B.Lei <popeblei@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: check handler entry to belong to supervisor modeClément Léger1-0/+6
When registering an SSE event, check for the handler_entry_pc to belong to supervisor mode domain using sbi_domain_check_addr_range(). Signed-off-by: Clément Léger <cleger@rivosinc.com> Reported-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: use PRV_S instead of hardcoded value for modeClément Léger1-2/+2
Rather then passing 1 to sbi_domain_check_addr_range() for supervisor mode, use PRV_S. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: call enable callback before sending IPIClément Léger1-3/+3
Move the enable callback call before sending the IPI. Even though the event is locked and no race condition can happen, this is more logical. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reported-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: remove superfluous sbi_list_empty() checkClément Léger1-3/+0
The list loop below that check is actually not looping if the list is empty so there was no need for this check. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reported-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: simplify 32bits overflow checkClément Léger1-1/+1
Rather than checking 32bits overflow with some absolute value, check the value to be different from the cast itself. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reported-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: rename sse_hart_unlock() to sse_enabled_event_unlock()Clément Léger1-5/+5
There was a naming incoherency between enabled events list lock/unlock. Rename sse_hart_unlock() to sse_enabled_event_unlock() to be coherent and reword comments above lock()/unlock() functions. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: sbi: sse: fix typos, comments and spacing errorsClément Léger1-11/+11
Fix some errors spotted by Samuel while reviewing the SSE implementation. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reported-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: tests: Add test for spinlocksIvan Orlov2-0/+44
Implement the test which covers some of the functions from the `riscv_locks.h` file. This test consists of 3 test cases: 1) For lock/unlock functions 2) Unsuccessful trylock (the lock was previously taken) 3) Successful trylock (the lock is free and can be taken) Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: tests: Add test for atomic_tIvan Orlov2-0/+146
Implement the test which covers some of the functions from the `riscv_atomic.h` header file. The test contains 9 test cases: 1) atomic read/write test 2) add/return test 3) sub/return test 4) cmpxchg test 5) atomic_xchg test 6) atomic_raw_set_bit test 7) atomic_raw_clear_bit test 8) atomic_set_bit test 9) atomic_clear_bit test Some of the test cases operate on the `test_atomic` variable. It gets initialized in the suite init function. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-05-07lib: tests: Add test suite init functionIvan Orlov1-0/+3
Allow to define an init function for the test suite. It could help us to initialize global variable once, and use them in multiple test cases after the initialization. For instance, if multiple test cases use the same atomic_t var, it could be helpful to call ATOMIC_INIT once during the suite initialization. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-04-10lib: sbi: sse_event_get() may return NULLHeinrich Schuchardt1-1/+1
sse_event_get() may return NULL. We should not dereference the return value in sbi_sse_exit() without checking. Fixes: c8cdf01d8f3a ("lib: sbi: Add support for Supervisor Software Events extension") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-04-10lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]Clément Léger1-0/+5
The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when adding a new extension, there is a mismatch between ids and extension names and it can even display corrupted extension names. Addresses-Coverity-ID: 1584994 Out-of-bounds read Fixes: 6bb6b61c27eb ("lib: sbi: Add support for smcsrind and smcdeleg") Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-04-05sbi: sbi_domain_context: Check privilege spec version before accessing ↵Yu Chien Peter Lin1-2/+4
S-mode CSRs SCOUNTEREN and SENVCFG may not be supported on certain RISC-V core, so check the existence of these CSRs via privilege spec version to prevent illegal instructions. Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-04-05lib: sbi: Wakeup non-coldboot HARTs early in the coldboot pathAnup Patel1-2/+9
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>
2024-04-05lib: sbi: Simplify wait_for_coldboot() implementationAnup Patel1-67/+3
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-05lib: sbi: Add SSE support for PMU eventsClément Léger2-0/+57
Add SSE callbacks registration to PMU driver in order to disable interrupt delegation for PMU interrupts. When interrupts are undelegated send the PMU SSE event upon LCOFIP IRQ. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-04-05lib: sbi: Implement SBI SSE extensionClément Léger3-0/+64
The SBI SSE extension defines a set of function that can be called to register and handle supervisor sofwtare events. This patch implements all of the functionality defined in the specification. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-04-05lib: sbi: Add support for Supervisor Software Events extensionClément Léger4-0/+1149
This extension [1] allows to deliver events from SBI to supervisor via a software mechanism. This extension defines events (either local or global) which are signaled by the SBI on specific signal sources (IRQ, exceptions, etc) and are injected to be executed in supervisor mode. [1] https://lists.riscv.org/g/tech-prs/message/798 Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2024-03-19lib: sbi: Extend sbi_trap_error() to dump state in a nested trapAnup Patel1-45/+60
The sbi_trap_error() should dump state of all in-flight traps upon failure in a nested trap so extend it accordingly. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Samuel Holland <samuel.holland@sifive.com>
2024-03-19lib: sbi: Pass trap context pointer to sbi_ecall_handler()Anup Patel2-2/+3
To be consistent with other trap handlers, pass trap context pointer to sbi_ecall_handler(). Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Tested-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Clément Léger <cleger@rivosinc.com>
2024-03-19lib: sbi: Remove regs parameter from trap irq handling functionsAnup Patel1-7/+6
The trap irq handling functions no longer require regs parameter so remove it. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Tested-by: Samuel Holland <samuel.holland@sifive.com>
2024-03-19lib: sbi: Remove regs paramter of sbi_irqchip_process()Anup Patel2-7/+7
The irqchip handlers will typically not need pointer to trap registers so remove regs parameter of sbi_irqchip_process(). Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Tested-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Clément Léger <cleger@rivosinc.com>