Skip to content

Commit dc6fcba

Browse files
guoren83paul-walmsley-sifive
authored andcommitted
riscv: Fixup obvious bug for fp-regs reset
CSR_MISA is defined in Privileged Architectures' spec: 3.1.1 Machine ISA Register misa. Every bit:1 indicate a feature, so we should beqz reset_done when there is no F/D bit in csr_misa register. Signed-off-by: Guo Ren <[email protected]> [[email protected]: fix typo in commit message] Fixes: 9e80635 ("riscv: clear the instruction cache and all registers when booting") Signed-off-by: Paul Walmsley <[email protected]>
1 parent 13cf4cf commit dc6fcba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/head.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ ENTRY(reset_regs)
251251
#ifdef CONFIG_FPU
252252
csrr t0, CSR_MISA
253253
andi t0, t0, (COMPAT_HWCAP_ISA_F | COMPAT_HWCAP_ISA_D)
254-
bnez t0, .Lreset_regs_done
254+
beqz t0, .Lreset_regs_done
255255

256256
li t1, SR_FS
257257
csrs CSR_STATUS, t1

0 commit comments

Comments
 (0)