Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm64: mm: Rework the 'rodata=' options

As per admin guide documentation, "rodata=on" should be the default on
platforms. Documentation/admin-guide/kernel-parameters.txt describes
these options as

rodata= [KNL,EARLY]
on Mark read-only kernel memory as read-only (default).
off Leave read-only kernel memory writable for debugging.
full Mark read-only kernel memory and aliases as read-only
[arm64]

But on arm64 platform, RODATA_FULL_DEFAULT_ENABLED is enabled by default,
so "rodata=full" is the default instead.

For parity with other architectures, namely x86, rework 'rodata=on' to
match the current "full" behaviour and replace 'rodata=full' with a new
'rodata=noalias' option which retains writable aliases in the direct map
for memory regions outside of the kernel image.

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Huang Shijie and committed by
Will Deacon
c0f303d7 b868fff5

+5 -4
+3 -2
Documentation/admin-guide/kernel-parameters.txt
··· 6405 6405 rodata= [KNL,EARLY] 6406 6406 on Mark read-only kernel memory as read-only (default). 6407 6407 off Leave read-only kernel memory writable for debugging. 6408 - full Mark read-only kernel memory and aliases as read-only 6409 - [arm64] 6408 + noalias Mark read-only kernel memory as read-only but retain 6409 + writable aliases in the direct map for regions outside 6410 + of the kernel image. [arm64] 6410 6411 6411 6412 rockchip.usb_uart 6412 6413 [EARLY]
+2 -2
arch/arm64/include/asm/setup.h
··· 21 21 if (!arg) 22 22 return false; 23 23 24 - if (!strcmp(arg, "full")) { 24 + if (!strcmp(arg, "on")) { 25 25 rodata_enabled = rodata_full = true; 26 26 return true; 27 27 } ··· 31 31 return true; 32 32 } 33 33 34 - if (!strcmp(arg, "on")) { 34 + if (!strcmp(arg, "noalias")) { 35 35 rodata_enabled = true; 36 36 rodata_full = false; 37 37 return true;