Commit 902d75cd authored by Huacai Chen's avatar Huacai Chen

LoongArch: Silence the boot warning about 'nokaslr'

The kernel parameter 'nokaslr' is handled before start_kernel(), so we
don't need early_param() to mark it technically. But it can cause a boot
warning as follows:

Unknown kernel command line parameters "nokaslr", will be passed to user space.

When we use 'init=/bin/bash', 'nokaslr' which passed to user space will
even cause a kernel panic. So we use early_param() to mark 'nokaslr',
simply print a notice and silence the boot warning (also fix a potential
panic). This logic is similar to RISC-V.
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent ee2daf71
...@@ -102,6 +102,14 @@ static inline __init unsigned long get_random_boot(void) ...@@ -102,6 +102,14 @@ static inline __init unsigned long get_random_boot(void)
return hash; return hash;
} }
static int __init nokaslr(char *p)
{
pr_info("KASLR is disabled.\n");
return 0; /* Print a notice and silence the boot warning */
}
early_param("nokaslr", nokaslr);
static inline __init bool kaslr_disabled(void) static inline __init bool kaslr_disabled(void)
{ {
char *str; char *str;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment