Page MenuHomeFreeBSD

riscv timer: fix interrupt handing
ClosedPublic

Authored by br on Mar 24 2025, 2:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 21, 2:21 AM
Unknown Object (File)
Sun, Nov 9, 1:47 AM
Unknown Object (File)
Fri, Nov 7, 3:53 AM
Unknown Object (File)
Wed, Nov 5, 9:43 AM
Unknown Object (File)
Mon, Nov 3, 4:15 PM
Unknown Object (File)
Sat, Nov 1, 3:19 AM
Unknown Object (File)
Oct 5 2025, 7:54 PM
Unknown Object (File)
Sep 29 2025, 3:52 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