On 18.09.24 15:56, Andrew Jones wrote:
Thanks Heinrich, I had also forgotten that distinction. So the last
question is whether or not we want to reset mstatus.FS to 1 instead of 3,
as is done in this patch.
Thanks,
drew
If the FD flag set to 3 (Dirty) indicates that "the corresponding state
has potentially been modified since the last context save". Upon context
switches the value of the floating point registers has to be saved.
The value 1 (Initial) implies that saving the registers on a context
change is not needed.
3 (Dirty) is the safest choice. This is why OpenSBI is also using it.
For reference:
3.1.6.6. Extension Context Status in mstatus Register
The RISC-V Instruction Set Manual: Volume II - Privileged Architecture
Version 2024-04-11
Best regards
Heinrich