]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Add Sstc extension support
authorPalmer Dabbelt <palmer@rivosinc.com>
Thu, 11 Aug 2022 21:41:52 +0000 (14:41 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 11 Aug 2022 21:41:52 +0000 (14:41 -0700)
commitc0ef39507eb6e9d458910d79a7e93842579e36c9
tree7925addedc2d883212d80f000d16a683c0984681
parentb7058446ed432337b772f86bdf2d414e600de251
parent0db41ecf8e0104a33545cff056a87d29d5340feb
RISC-V: Add Sstc extension support

This series implements Sstc extension support which was ratified
recently.  Before the Sstc extension, an SBI call is necessary to
generate timer interrupts as only M-mode have access to the timecompare
registers. Thus, there is significant latency to generate timer
interrupts at kernel.  For virtualized enviornments, its even worse as
the KVM handles the SBI call and uses a software timer to emulate the
timecomapre register.

Sstc extension solves both these problems by defining a
stimecmp/vstimecmp at supervisor (host/guest) level. It allows kernel to
program a timer and recieve interrupt without supervisor execution
enviornment (M-mode/HS mode) intervention.

* palmer/riscv-sstc:
  RISC-V: Prefer sstc extension if available
  RISC-V: Enable sstc extension parsing from DT
  RISC-V: Add SSTC extension CSR details
arch/riscv/include/asm/csr.h
arch/riscv/include/asm/hwcap.h
arch/riscv/kernel/cpu.c
arch/riscv/kernel/cpufeature.c
drivers/clocksource/timer-riscv.c