diff options
author | Vincent Chen <[email protected]> | 2020-02-21 10:47:54 +0800 |
---|---|---|
committer | Palmer Dabbelt <[email protected]> | 2020-03-03 10:27:45 -0800 |
commit | 0cff8bff7af886af0923d5c91776cd51603e531f (patch) | |
tree | c357d85caec49d5de84a84d7398a30e7a5d3c375 /drivers/usb/cdns3/cdns3-imx.c | |
parent | 98d54f81e36ba3bf92172791eba5ca5bd813989b (diff) |
riscv: avoid the PIC offset of static percpu data in module beyond 2G limits
The compiler uses the PIC-relative method to access static variables
instead of GOT when the code model is PIC. Therefore, the limitation of
the access range from the instruction to the symbol address is +-2GB.
Under this circumstance, the kernel cannot load a kernel module if this
module has static per-CPU symbols declared by DEFINE_PER_CPU(). The reason
is that kernel relocates the .data..percpu section of the kernel module to
the end of kernel's .data..percpu. Hence, the distance between the per-CPU
symbols and the instruction will exceed the 2GB limits. To solve this
problem, the kernel should place the loaded module in the memory area
[&_end-2G, VMALLOC_END].
Signed-off-by: Vincent Chen <[email protected]>
Suggested-by: Alexandre Ghiti <[email protected]>
Suggested-by: Anup Patel <[email protected]>
Tested-by: Alexandre Ghiti <[email protected]>
Tested-by: Carlos de Paula <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-imx.c')
0 files changed, 0 insertions, 0 deletions