freebsd-src/sys/riscv
Mitchell Horne 6ae48dd870 Fix global pointer relaxations in the RISC-V kernel
The gp register is intended to used by the linker as another means of
performing relaxations, and should point to the small data section (.sdata).

Currently gp is being used as the pcpu pointer within the kernel, but the more
appropriate choice for this is the tp register, which is unused.

Swap existing usage of gp with tp within the kernel, and set up gp properly
at boot with the value of __global_pointer$ for all harts.

Additionally, remove some cases of accessing tp from the PCB, as it is not
part of the per-thread state. The user's tp and gp should be tracked only
through the trapframe.

Reviewed by:	markj, jhb
Approved by:	markj (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D19893
2019-06-09 15:43:38 +00:00
..
conf Remove IPSEC from GENERIC due to performance issues 2019-05-09 22:38:15 +00:00
include Fix global pointer relaxations in the RISC-V kernel 2019-06-09 15:43:38 +00:00
riscv Fix global pointer relaxations in the RISC-V kernel 2019-06-09 15:43:38 +00:00