[PATCH v2 1/4] arm64: make rodata=on behaviour be the original rodata=full

Anshuman Khandual anshuman.khandual at arm.com
Thu Dec 5 20:21:09 PST 2024



On 11/26/24 14:26, Huang Shijie wrote:
> Make rodata=on behaviour be the original rodata=full.
> After this patch, the rodata=on will be the default,
> and the arm64 kernel behaviour will follow the
> Documentation/admin-guide/kernel-parameters.txt:
> 	rodata=		[KNL,EARLY]
> 		on	Mark read-only kernel memory as read-only (default).
> 
> Signed-off-by: Huang Shijie <shijie at os.amperecomputing.com>
> ---
>  arch/arm64/include/asm/setup.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/setup.h b/arch/arm64/include/asm/setup.h
> index ba269a7a3201..5ded3bd11476 100644
> --- a/arch/arm64/include/asm/setup.h
> +++ b/arch/arm64/include/asm/setup.h
> @@ -21,7 +21,7 @@ static inline bool arch_parse_debug_rodata(char *arg)
>  	if (!arg)
>  		return false;
>  
> -	if (!strcmp(arg, "full")) {
> +	if (!strcmp(arg, "on")) {
>  		rodata_enabled = rodata_full = true;
>  		return true;
>  	}
> @@ -31,7 +31,7 @@ static inline bool arch_parse_debug_rodata(char *arg)
>  		return true;
>  	}
>  
> -	if (!strcmp(arg, "on")) {
> +	if (!strcmp(arg, "full")) {
>  		rodata_enabled = true;
>  		rodata_full = false;
>  		return true;

After this patch we have the following and seems like 'rodata=full'
is temporarily broken until the subsequent patches come in ?

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, "full")) {
                rodata_enabled = true;
                rodata_full = false;     <---------------- here
                return true;
        }

        return false;
}



More information about the linux-arm-kernel mailing list