Page MenuHomeFreeBSD

Fix SSTC extension support
ClosedPublic

Authored by br on Fri, May 17, 8:19 AM.
Tags
None
Referenced Files
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)
Tue, May 21, 4:51 AM
Unknown Object (File)
Sun, May 19, 5:16 PM
Unknown Object (File)
Sun, May 19, 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

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

Event Timeline

br requested review of this revision.Fri, May 17, 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.Fri, May 17, 2:19 PM

use UL suffix to not rely on sign-extension

This revision now requires review to proceed.Fri, May 17, 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.