summaryrefslogtreecommitdiff
path: root/lib/test_objagg.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2021-04-29 18:05:00 +0300
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-05-06 19:40:12 +0300
commit8db6f937f4e76d9dd23795311fc14f0a5c0ac119 (patch)
tree4fc671a0bf9717eb421b2e053b7c8855190005ce /lib/test_objagg.c
parent939b7cbc00906b02c6eae6a380ad6c24c7a1e043 (diff)
downloadlinux-8db6f937f4e76d9dd23795311fc14f0a5c0ac119.tar.xz
riscv: Only extend kernel reservation if mapped read-only
When the kernel mapping was moved outside of the linear mapping, the kernel memory reservation was increased, to take into account mapping granularity. However, this is done unconditionally, regardless of whether the kernel memory is mapped read-only or not. If this extension is not needed, up to 2 MiB may be lost, which has a big impact on e.g. Canaan K210 (64-bit nommu) platforms with only 8 MiB of RAM. Reclaim the lost memory by only extending the reserved region when needed, i.e. depending on a simplified version of the conditional logic around the call to protect_kernel_linear_mapping_text_rodata(). Fixes: 2bfc6cd81bd17e43 ("riscv: Move kernel mapping outside of linear mapping") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Alexandre Ghiti <alex@ghiti.fr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'lib/test_objagg.c')
0 files changed, 0 insertions, 0 deletions