Page MenuHomeFreeBSD

Fix SSTC extension support
ClosedPublic

Authored by br on May 17 2024, 8:19 AM.
Tags
None
Referenced Files
F102696771: D45226.id138703.diff
Fri, Nov 15, 11:56 PM
Unknown Object (File)
Fri, Nov 15, 11:41 AM
Unknown Object (File)
Mon, Nov 11, 11:34 AM
Unknown Object (File)
Tue, Nov 5, 3:45 PM
Unknown Object (File)
Oct 15 2024, 7:46 PM
Unknown Object (File)
Oct 15 2024, 4:13 AM
Unknown Object (File)
Oct 13 2024, 11:40 AM
Unknown Object (File)
Oct 12 2024, 7:47 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.