mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: kernel test robot <oliver.sang@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	x86@kernel.org, lkp@lists.01.org, lkp@intel.com,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [jump_label, x86]  e7bf1ba97a: BUG:unable_to_handle_page_fault_for_address
Date: Wed, 23 Jun 2021 10:14:00 +0200	[thread overview]
Message-ID: <YNLtSKUtqxqPxmGP@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210623022826.GA20282@xsang-OptiPlex-9020>

On Wed, Jun 23, 2021 at 10:28:26AM +0800, kernel test robot wrote:

> [  222.094341] BUG: unable to handle page fault for address: ffffffff83ccffe0

> [  222.283298] insn_decode (kbuild/src/consumer/arch/x86/lib/insn.c:747) 
> [  222.286668] arch_jump_entry_size (kbuild/src/consumer/arch/x86/kernel/jump_label.c:27) 
> [  222.303592] jump_label_text_reserved (kbuild/src/consumer/kernel/jump_label.c:312 kbuild/src/consumer/kernel/jump_label.c:325 kbuild/src/consumer/kernel/jump_label.c:791) 
> [  222.308170] register_kprobe (kbuild/src/consumer/kernel/kprobes.c:2052) 

(FWIW, maybe you can run s'kbuild/src/consumer/''g on the thing before
sending)

I *think* the below might help, can you try?

---
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index bdb0681bece8..c44381dcf25b 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -316,14 +316,16 @@ static int addr_conflict(struct jump_entry *entry, void *start, void *end)
 }
 
 static int __jump_label_text_reserved(struct jump_entry *iter_start,
-		struct jump_entry *iter_stop, void *start, void *end)
+		struct jump_entry *iter_stop, void *start, void *end, bool init)
 {
 	struct jump_entry *iter;
 
 	iter = iter_start;
 	while (iter < iter_stop) {
-		if (addr_conflict(iter, start, end))
-			return 1;
+		if (init || !jump_entry_is_init(iter)) {
+			if (addr_conflict(iter, start, end))
+				return 1;
+		}
 		iter++;
 	}
 
@@ -548,6 +550,7 @@ static void static_key_set_mod(struct static_key *key,
 static int __jump_label_mod_text_reserved(void *start, void *end)
 {
 	struct module *mod;
+	bool init;
 	int ret;
 
 	preempt_disable();
@@ -555,6 +558,7 @@ static int __jump_label_mod_text_reserved(void *start, void *end)
 	WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);
 	if (!try_module_get(mod))
 		mod = NULL;
+	init = mod->state == MODULE_STATE_COMING;
 	preempt_enable();
 
 	if (!mod)
@@ -562,7 +566,7 @@ static int __jump_label_mod_text_reserved(void *start, void *end)
 
 	ret = __jump_label_text_reserved(mod->jump_entries,
 				mod->jump_entries + mod->num_jump_entries,
-				start, end);
+				start, end, init);
 
 	module_put(mod);
 
@@ -788,8 +792,9 @@ early_initcall(jump_label_init_module);
  */
 int jump_label_text_reserved(void *start, void *end)
 {
+	bool init = system_state < SYSTEM_RUNNING;
 	int ret = __jump_label_text_reserved(__start___jump_table,
-			__stop___jump_table, start, end);
+			__stop___jump_table, start, end, init);
 
 	if (ret)
 		return ret;

  reply	other threads:[~2021-06-23  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23  2:28 kernel test robot
2021-06-23  8:14 ` Peter Zijlstra [this message]
2021-06-24  6:32   ` [LKP] " Liu, Yujie
2021-06-28  9:22     ` Peter Zijlstra
2021-06-28 10:08       ` Peter Zijlstra
2021-06-28 11:36         ` Peter Zijlstra
2021-06-29  5:59           ` Liu, Yujie

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=YNLtSKUtqxqPxmGP@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lkp@lists.01.org \
    --cc=mingo@kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®