riscv: add floating point insn support to misaligned access emulation
authorClément Léger <cleger@rivosinc.com>
Wed, 4 Oct 2023 15:14:01 +0000 (17:14 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 1 Nov 2023 15:34:55 +0000 (08:34 -0700)
commit7c586a555a48a952f64d883d2f20402fb61d9164
treeb4ab42254c91cc16877ca13b79473c90b535c264
parent89c12fecdc4d46c1f08a81dab5d305304cc626eb
riscv: add floating point insn support to misaligned access emulation

This support is partially based of openSBI misaligned emulation floating
point instruction support. It provides support for the existing
floating point instructions (both for 32/64 bits as well as compressed
ones). Since floating point registers are not part of the pt_regs
struct, we need to modify them directly using some assembly. We also
dirty the pt_regs status in case we modify them to be sure context
switch will save FP state. With this support, Linux is on par with
openSBI support.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231004151405.521596-5-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/fpu.S
arch/riscv/kernel/traps_misaligned.c