fix(riscv): make sip.SSIP software-writable regardless of mideleg - #313
fix(riscv): make sip.SSIP software-writable regardless of mideleg#313carlosqwqqwq wants to merge 4 commits into
Conversation
|
The Root cause: this PR's CI merge base is |
|
Thank you for the report. Independent review of the privileged ISA found the proposed behavior is not architectural: sip/sie are restricted views of mip/mie, and when a bit is not delegated by mideleg the corresponding sip/sie bit is read-only zero. The later statement that sip.SSIP is writable applies to an implemented supervisor-visible SSIP bit; it does not override the delegation rule. The existing delegated-view behavior is therefore retained, and I am closing this PR without taking its code. |
Summary
The
sipCSR's SSIP bit must be software-writable regardless ofmideleg; mideleg only controls interrupt delegation, not writability. RAX'sCsr::Sipwrite branch usedsupervisor_software_interrupt_mask()=mideleg & (1<<1), so withmideleg=0writingsip.SSIP=1was silently dropped.This change uses a fixed SSIP mask
(1 << 1) & xmask()forsipwrites, decoupling writability from delegation.Validation
sip_ssip_writable_without_mideleg: SSIP set/clear works with mideleg=0, and non-SSIP sip bits are not stored.cargo test --libtargeted test passes; full suite shows no regressions.Closes #308