[PATCH 1/1] lib: sbi_misaligned_ldst: Add handling of vector load/store

Vivian Wang uwu at dram.page
Wed Oct 16 12:33:52 PDT 2024


On 10/16/24 18:35, Nylon Chen wrote:
> Add exception handling vector instructions from
>
> the vector extension to the sbi_misaligned_ldst library.
>
> This implementation references the misaligned_vec_ldst
> implementation in the riscv-pk project.
>
> Co-developed-by: Zong Li <zong.li at sifive.com>
> Signed-off-by: Zong Li <zong.li at sifive.com>
> Signed-off-by: Nylon Chen <nylon.chen at sifive.com>
> Reviewed-by: Andy Chiu <andy.chiu at sifive.com>
> ---
>  Makefile                     |  15 +-
>  include/sbi/riscv_encoding.h | 385 ++++++++++++++++++++++++++++++++++-
>  include/sbi/sbi_trap_ldst.h  |   9 +
>  lib/sbi/Kconfig              |   4 +
>  lib/sbi/objects.mk           |   1 +
>  lib/sbi/sbi_trap_ldst.c      |  23 ++-
>  lib/sbi/sbi_trap_v_ldst.c    | 341 +++++++++++++++++++++++++++++++
>  7 files changed, 766 insertions(+), 12 deletions(-)
>  create mode 100644 lib/sbi/sbi_trap_v_ldst.c
>
> *snip*

I didn't see any mention of mstatus in the patch. Maybe I missed it but
since we eventually reload mstatus, we should explicitly set mstatus.VS
to "Dirty" (both bits 1) in the saved registers. See [1] for handling of
mstatus.FS.

[1]: https://patchwork.ozlabs.org/project/opensbi/patch/20230906090114.24625-1-greentime.hu@sifive.com/




More information about the opensbi mailing list