diff options
| author | whensun <theodoruswensanfebruanto025@gmail.com> | 2026-08-28 14:31:04 -0700 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-09-05 12:33:48 +0530 |
| commit | 7774b82e4aaa6fa98d1430b02d614eadd339a8a2 (patch) | |
| tree | 2565865e9e46f23af0304b2b5b65a33a07e75eb9 | |
| parent | bf459f85bf75d86cbf028e136067ce96aefde221 (diff) | |
| download | opensbi-7774b82e4aaa6fa98d1430b02d614eadd339a8a2.tar.gz opensbi-7774b82e4aaa6fa98d1430b02d614eadd339a8a2.zip | |
lib: sbi: Fix FP state enable in sbi_fp_save
sbi_fp_save() currently sets mstatus.VS before executing floating-point
store instructions. VS controls vector state and does not enable
floating-point instructions.
Set mstatus.FS instead, matching sbi_fp_restore(), so floating-point
state can be saved when FS was previously Off.
Fixes: 718e1d194f5a ("lib: sbi: Add floating-point context save/restore support.")
Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com>
Co-developed-by: Huamao Wu <huamao.wu@spacemit.com>
Signed-off-by: Huamao Wu <huamao.wu@spacemit.com>
Link: https://lore.kernel.org/r/20260828213104.84490-1-theodoruswensanfebruanto025@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org>
| -rw-r--r-- | lib/sbi/sbi_fp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi/sbi_fp.c b/lib/sbi/sbi_fp.c index c8941252..38fb7a01 100644 --- a/lib/sbi/sbi_fp.c +++ b/lib/sbi/sbi_fp.c @@ -20,7 +20,7 @@ void sbi_fp_save(struct sbi_fp_context *dst) if (!dst) return; - mstatus_orig = csr_read_set(CSR_MSTATUS, MSTATUS_VS); + mstatus_orig = csr_read_set(CSR_MSTATUS, MSTATUS_FS); asm volatile( #if defined(__riscv_d) |
