Skip to content

arch: riscv: the s0 dumped during a fatal error is not correct #79298

@ycsin

Description

@ycsin

Describe the bug
The content of the s0 register dump during a fatal error is not the one at the time of the crash. On exception the isr.S, made a copy of the s0 register and then made some changes to the reg, but it didn't restore the s0 to the saved value before it jumps to the z_riscv_fatal_error_csf().

To Reproduce

  1. Run the test added in arch: riscv: isr.S: restore s0 before jumping to z_riscv_fatal_error_csf #79096 with Zephyr v3.7-branch
  2. The test will fail

Expected behavior
The test should pass

Impact
Incorrect s0 content shown in the fatal error message

Metadata

Metadata

Labels

area: RISCVRISCV Architecture (32-bit & 64-bit)bugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions