HomeFreeBSD

riscv: dcache flush hooks

Description

riscv: dcache flush hooks

Cache management operations were, for a long time, unspecified by the
RISC-V ISA, and thus these functions have been no-ops. To cope, hardware
with non-coherent I/O has implemented custom cache flush mechanisms,
either in the form of custom instructions or special device registers.
Additionally, the RISC-V CMO extension is ratified and these official
instructions will start to show up in hardware eventually. Therefore, a
method is needed to select the dcache management routines at runtime.

Add a simple set of function hooks, as well as a routine to install them
and specify the minimum dcache line size. The first consumer will be the
non-standard cache management instructions for T-HEAD CPUs.

The unused I-cache variables and macros are removed.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47454

Details

Provenance
mhorneAuthored on Nov 21 2024, 6:11 PM
Differential Revision
D47454: riscv: dcache flush hooks
Parents
rGbf06074106cf: ccr(4): Belatedly bump .Dd for prior commit
Branches
Unknown
Tags
Unknown

Event Timeline

br added inline comments.
/sys/riscv/riscv/cache.c
39

the comment does not fit the line