riscv: avoid the PIC offset of static percpu data in module beyond 2G limits
Vincent Chen authored
[ Upstream commit 0cff8bff

 ]

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: default avatarVincent Chen <vincent.chen@sifive.com>
Suggested-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
Suggested-by: default avatarAnup Patel <anup@brainfault.org>
Tested-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
Tested-by: Carlos...
a3f34939
Name Last commit Last update
Documentation ACPI: watchdog: Allow disabling WDAT at boot
LICENSES LICENSES: Rename other to deprecated
arch riscv: avoid the PIC offset of static percpu data in module beyond 2G limits
block blk-mq: insert flush request to the front of dispatch queue
certs PKCS#7: Refactor verify_pkcs7_signature()
crypto crypto: rename sm3-256 to sm3 in hash_algo_name
drivers dm integrity: use dm_bio_record and dm_bio_restore
fs cifs: add missing mount option to /proc/mounts
include driver code: clarify and fix platform device DMA mask allocation
init kbuild: remove header compile test
ipc Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"
kernel signal: avoid double atomic counter increments for user accounting
lib kbuild: move headers_check rule to usr/include/Makefile
mm mm: slub: add missing TID bump in kmem_cache_alloc_bulk()
net ipv4: ensure rcu_read_lock() in cipso_v4_error()
samples samples/bpf: Set -fno-stack-protector when building BPF programs
scripts kbuild: move headers_check rule to usr/include/Makefile
security efi: Only print errors about failing to get certs if EFI vars are found
sound ALSA: hda/realtek - Fixed one of HP ALC671 platform Headset Mic supported
tools selftests/rseq: Fix out-of-tree compilation
usr kbuild: fix 'No such file or directory' warning when cleaning
virt KVM: Check for a bad hva before dropping into the ghc slow path
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.