]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Trim duplicate CSR swaps from user exceptions.
authorjhb <jhb@FreeBSD.org>
Thu, 30 Jan 2020 22:19:48 +0000 (22:19 +0000)
committerjhb <jhb@FreeBSD.org>
Thu, 30 Jan 2020 22:19:48 +0000 (22:19 +0000)
commit8363d7537ad9a462360c83b427295f729041504c
tree73eab73909b4e6e79a479187696d15c370f4f487
parent3f1b6975a2baf85a71ec51bdaffe8126168031a8
Trim duplicate CSR swaps from user exceptions.

The stack pointer is swapped with the sscratch CSR just before the
jump to cpu_exception_handler_user where the first instruction swaps
it again.  The two swaps together are a no-op, but the csr swap
instructions can be expensive (e.g. on Bluespec RISC-V cores csr swap
instructions force a full pipeline stall).

Reported by: jrtc27
Reviewed by: br
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23394
sys/riscv/riscv/exception.S