Page MenuHomeFreeBSD

Fix SSTC extension support
ClosedPublic

Authored by br on May 17 2024, 8:19 AM.
Tags
None
Referenced Files
F95499360: D45226.diff
Sat, Sep 21, 5:11 AM
Unknown Object (File)
Fri, Sep 20, 3:02 PM
Unknown Object (File)
Thu, Sep 19, 10:50 AM
Unknown Object (File)
Tue, Sep 17, 7:09 PM
Unknown Object (File)
Tue, Sep 17, 4:24 AM
Unknown Object (File)
Sun, Sep 15, 10:27 PM
Unknown Object (File)
Sat, Sep 14, 11:22 PM
Unknown Object (File)
Thu, Sep 12, 5:57 PM
Subscribers

Details

Summary

Based on SSTC spec (1):

"If the stimecmp (supervisor-mode timer compare) register is implemented, STIP is read-only in mip and reflects the supervisor-level timer interrupt signal resulting from stimecmp. This timer interrupt signal is cleared by writing stimecmp with a value greater than the current time value."

This fixes operation in Spike with SSTC extension enabled, e.g.

$ spike --isa RV64IMAFDCH_zicntr_zihpm_sstc

[1]. https://tools.cloudbear.ru/docs/riscv-sstc-0.5.4-20211013.pdf

Test Plan

Tested in Spike only

Diff Detail

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

Event Timeline

br requested review of this revision.May 17 2024, 8:19 AM
br created this revision.
mhorne added inline comments.
sys/riscv/riscv/timer.c
147

We can rely on sign-extension or should it be -1UL?

This revision is now accepted and ready to land.May 17 2024, 2:19 PM

use UL suffix to not rely on sign-extension

This revision now requires review to proceed.May 17 2024, 10:29 PM
This revision is now accepted and ready to land.May 22 2024, 1:48 PM
This revision was automatically updated to reflect the committed changes.