Skip to content

Commit 50f1761

Browse files
ardbiesheuvelwilldeacon
authored andcommitted
arm64/kernel: Move 'nokaslr' parsing out of early idreg code
Parsing and ignoring 'nokaslr' can be done from anywhere, except from the code that runs very early and is therefore built with limitations on the kind of relocations it is permitted to use. So move it to a source file that is part of the ordinary kernel build. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20231129111555.3594833-63-ardb@google.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent ea48626 commit 50f1761

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

arch/arm64/kernel/idreg-override.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ static const struct {
199199
{ "nokaslr", "arm64_sw.nokaslr=1" },
200200
};
201201

202-
static int __init parse_nokaslr(char *unused)
203-
{
204-
/* nokaslr param handling is done by early cpufeature code */
205-
return 0;
206-
}
207-
early_param("nokaslr", parse_nokaslr);
208-
209202
static int __init parse_hexdigit(const char *p, u64 *v)
210203
{
211204
// skip "0x" if it comes next

arch/arm64/kernel/kaslr.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ void __init kaslr_init(void)
3636
pr_info("KASLR enabled\n");
3737
__kaslr_is_enabled = true;
3838
}
39+
40+
static int __init parse_nokaslr(char *unused)
41+
{
42+
/* nokaslr param handling is done by early cpufeature code */
43+
return 0;
44+
}
45+
early_param("nokaslr", parse_nokaslr);

0 commit comments

Comments
 (0)