mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 17:01:25 -05:00
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>
45 lines
792 B
C
45 lines
792 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef __ARM64_ASM_SETUP_H
|
|
#define __ARM64_ASM_SETUP_H
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <uapi/asm/setup.h>
|
|
|
|
/*
|
|
* These two variables are used in the head.S file.
|
|
*/
|
|
extern phys_addr_t __fdt_pointer __initdata;
|
|
extern u64 __cacheline_aligned boot_args[4];
|
|
|
|
static inline bool arch_parse_debug_rodata(char *arg)
|
|
{
|
|
extern bool rodata_enabled;
|
|
extern bool rodata_full;
|
|
|
|
if (!arg)
|
|
return false;
|
|
|
|
if (!strcmp(arg, "on")) {
|
|
rodata_enabled = rodata_full = true;
|
|
return true;
|
|
}
|
|
|
|
if (!strcmp(arg, "off")) {
|
|
rodata_enabled = rodata_full = false;
|
|
return true;
|
|
}
|
|
|
|
if (!strcmp(arg, "noalias")) {
|
|
rodata_enabled = true;
|
|
rodata_full = false;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
#define arch_parse_debug_rodata arch_parse_debug_rodata
|
|
|
|
#endif
|