LKML Archive on
 help / color / Atom feed
From: Kees Cook <>
To: Andrew Morton <>
Cc: Catalin Marinas <>,
	Ard Biesheuvel <>,,,
	Alexander Potapenko <>, Qian Cai <>
Subject: [PATCH v2] arm64: Move jump_label_init() before parse_early_param()
Date: Thu, 27 Jun 2019 10:06:16 -0700
Message-ID: <201906271003.005303B52@keescook> (raw)

While jump_label_init() was moved earlier in the boot process in commit
efd9e03facd0 ("arm64: Use static keys for CPU features"), it wasn't
early enough for early params to use it. The old state of things was as
described here...

init/main.c calls out to arch-specific things before general jump
label and early param handling:

asmlinkage __visible void __init start_kernel(void)
        /* parameters may set static keys */

x86 setup_arch() wants those earlier, so it handles jump label and
early param:

void __init setup_arch(char **cmdline_p)

arm64 setup_arch() only had early param:

void __init setup_arch(char **cmdline_p)

with jump label later in smp_prepare_boot_cpu():

void __init smp_prepare_boot_cpu(void)

This moves arm64 jump_label_init() from smp_prepare_boot_cpu() to
setup_arch(), as done already on x86, in preparation from early param
usage in the init_on_alloc/free() series:

Signed-off-by: Kees Cook <>
Acked-by: Ard Biesheuvel <>
Acked-by: Catalin Marinas <>
- add Acks
- direct to akpm's tree since init_on_alloc() depends on this for arm64
 arch/arm64/kernel/setup.c | 5 +++++
 arch/arm64/kernel/smp.c   | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 7e541f947b4c..9c4bad7d7131 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -283,6 +283,11 @@ void __init setup_arch(char **cmdline_p)
+	/*
+	 * Initialise the static keys early as they may be enabled by the
+	 * cpufeature code and early parameters.
+	 */
+	jump_label_init();
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 6dcf9607d770..20c456b3862c 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -424,11 +424,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
 void __init smp_prepare_boot_cpu(void)
-	/*
-	 * Initialise the static keys early as they may be enabled by the
-	 * cpufeature code.
-	 */
-	jump_label_init();

Kees Cook

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201906271003.005303B52@keescook \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git
	git clone --mirror lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone