New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various RISC-V FPU context switching fixes #54207
Conversation
- IRQ state for the interrupted context corresponds to the PIE bit not the IE bit. - Restoring the saved FPU state should clear the entire field before or'ing wanted bits in. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The FRCSR, FSCSR, FRRM, FSRM, FSRMI, FRFLAGS, FSFLAGS and FSFLAGSI are in fact CSR instructions targeting the fcsr, frm and fflags registers. They should be caught as FPU instructions as well. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Some implementations may not capture the faulting instruction in mtval and set it to zero when an illegal instruction fault is raised This is notably the case with QEMU version 7.0.0 when a CSR instruction is involved. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The RISC-V FPU context switching code is intricate and sometimes subtle. Here's a test that exercizes various code paths to ensure they work as intended, and to confirm that the target hardware does behave as expected too. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Hi fellow hackers,
It seems that the bye, pottendo |
Please let's move this conversation to issue #54205.
|
also it is really not nice to maintainers and project asking for support on downstream only boards and ports. |
Hi, |
Fix various issues with the new FPU context switching code on RISC-V
and provide a comprehensive test for that code.
Fixed issues are:
IRQ state for the interrupted context corresponds to the PIE bit not
the IE bit.
Restoring the saved FPU state should clear the entire field before
or'ing wanted bits in.
Properly trap access to the fcsr, frm and fflags registers.
Work around platforms that don't capture faulting instructions in mtval.
This is notably the case on QEMU with the previously mentioned registers.
Fixes #54208