Page MenuHomeFreeBSD

Fix SSTC extension support
ClosedPublic

Authored by br on May 17 2024, 8:19 AM.
Tags
None
Referenced Files
F86442724: D45226.diff
Thu, Jun 20, 12:10 PM
Unknown Object (File)
Wed, May 22, 6:54 PM
Unknown Object (File)
Wed, May 22, 4:59 AM
Unknown Object (File)
Wed, May 22, 3:24 AM
Unknown Object (File)
May 21 2024, 4:51 AM
Unknown Object (File)
May 19 2024, 5:16 PM
Unknown Object (File)
May 19 2024, 5:33 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

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.Wed, May 22, 1:48 PM
This revision was automatically updated to reflect the committed changes.