Page MenuHomeFreeBSD

riscv timer: fix interrupt handing
ClosedPublic

Authored by br on Mar 24 2025, 2:58 PM.
Tags
None
Referenced Files
F121034021: D49487.id152693.diff
Mon, Jun 23, 2:29 AM
Unknown Object (File)
Sun, Jun 22, 1:51 AM
Unknown Object (File)
Sat, Jun 14, 9:39 PM
Unknown Object (File)
Thu, Jun 12, 10:59 PM
Unknown Object (File)
Tue, Jun 10, 9:17 PM
Unknown Object (File)
Sun, Jun 8, 3:07 PM
Unknown Object (File)
Fri, Jun 6, 6:04 AM
Unknown Object (File)
Thu, Jun 5, 5:02 PM
Subscribers

Details

Summary

We have got a hardware (Codasip A730) that does not clear the timer pending bit by CSR request from supervisor, instead it expects us to do an SBI call.

Based on the spec the behavior of the hardware is correct as STIP is read-only in SIP:
https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?plain=1#L401

Upon reception of SBI request, the machine mode software clears the STIP in MIP:
https://github.com/riscv/riscv-isa-manual/blob/main/src/machine.adoc?plain=1#L1464

Test Plan

Tested on Codasip

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable