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)
Sun, Oct 5, 7:54 PM
Unknown Object (File)
Mon, Sep 29, 3:52 PM
Unknown Object (File)
Mon, Sep 29, 3:51 PM
Unknown Object (File)
Mon, Sep 29, 3:51 PM
Unknown Object (File)
Wed, Sep 24, 2:07 AM
Unknown Object (File)
Mon, Sep 22, 11:07 AM
Unknown Object (File)
Wed, Sep 17, 5:25 AM
Unknown Object (File)
Sep 14 2025, 6:12 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