All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: lkp@lists.01.org
Subject: Re: [KEYS] 4a00e5e212: WARNING:at_arch/x86/kernel/static_call.c:#__static_call_validate
Date: Wed, 17 Mar 2021 10:02:05 +0100	[thread overview]
Message-ID: <YFHFjarVo7HAP7pg@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <YFHE9CjanDAD4l5M@hirez.programming.kicks-ass.net>

[-- Attachment #1: Type: text/plain, Size: 2992 bytes --]

On Wed, Mar 17, 2021 at 09:59:32AM +0100, Peter Zijlstra wrote:
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 5e5388a38e2a..6fef1155e73a 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -850,6 +850,21 @@ static int add_ignore_alternatives(struct objtool_file *file)
>  	return 0;
>  }
>  
> +static inline void static_call_add(struct instruction *insn,
> +				   struct objtool_file *file)
> +{
> +	if (!strcmp(insn->sec->name, ".exit.text")) {
> +		WARN_FUNC("static_call in .exit.text, skipping inline paching",
> +			  insn->sec, insn->offset);
> +		return;
> +	}

Duh, that needs to be in the below condition... /me goes fetch more
wake-up juice :/

> +	if (insn->call_dest->static_call_tramp) {
> +		list_add_tail(&insn->static_call_node,
> +			      &file->static_call_list);
> +	}
> +}

---
 tools/objtool/check.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 5e5388a38e2a..70cfd8bf95fd 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -850,6 +850,22 @@ static int add_ignore_alternatives(struct objtool_file *file)
 	return 0;
 }
 
+static inline void static_call_add(struct instruction *insn,
+				   struct objtool_file *file)
+{
+	if (!insn->call_dest->static_call_tramp)
+		return;
+
+	if (!strcmp(insn->sec->name, ".exit.text")) {
+		WARN_FUNC("static_call in .exit.text, skipping inline paching",
+			  insn->sec, insn->offset);
+		return;
+	}
+
+	list_add_tail(&insn->static_call_node,
+		      &file->static_call_list);
+}
+
 /*
  * Find the destination instructions for all jumps.
  */
@@ -888,10 +904,7 @@ static int add_jump_destinations(struct objtool_file *file)
 		} else if (insn->func) {
 			/* internal or external sibling call (with reloc) */
 			insn->call_dest = reloc->sym;
-			if (insn->call_dest->static_call_tramp) {
-				list_add_tail(&insn->static_call_node,
-					      &file->static_call_list);
-			}
+			static_call_add(insn, file);
 			continue;
 		} else if (reloc->sym->sec->idx) {
 			dest_sec = reloc->sym->sec;
@@ -950,10 +963,7 @@ static int add_jump_destinations(struct objtool_file *file)
 
 				/* internal sibling call (without reloc) */
 				insn->call_dest = insn->jump_dest->func;
-				if (insn->call_dest->static_call_tramp) {
-					list_add_tail(&insn->static_call_node,
-						      &file->static_call_list);
-				}
+				static_call_add(insn, file);
 			}
 		}
 	}
@@ -2746,10 +2756,8 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
 			if (dead_end_function(file, insn->call_dest))
 				return 0;
 
-			if (insn->type == INSN_CALL && insn->call_dest->static_call_tramp) {
-				list_add_tail(&insn->static_call_node,
-					      &file->static_call_list);
-			}
+			if (insn->type == INSN_CALL)
+				static_call_add(insn, file);
 
 			break;
 

  reply	other threads:[~2021-03-17  9:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 14:23 [KEYS] 4a00e5e212: WARNING:at_arch/x86/kernel/static_call.c:#__static_call_validate kernel test robot
2021-03-16  8:04 ` Sumit Garg
2021-03-17  3:01   ` Oliver Sang
2021-03-17  7:25     ` Sumit Garg
2021-03-17  8:41       ` Peter Zijlstra
2021-03-17  8:59         ` Peter Zijlstra
2021-03-17  9:02           ` Peter Zijlstra [this message]
2021-03-17 11:55             ` Sumit Garg
2021-03-17 12:45               ` [PATCH] objtool,static_call: Don't emit static_call_site for .exit.text Peter Zijlstra
2021-03-17 12:45                 ` [PATCH] objtool, static_call: " Peter Zijlstra
2021-03-17 13:37                 ` [PATCH] objtool,static_call: " Sumit Garg
2021-03-17 13:37                   ` [PATCH] objtool, static_call: " Sumit Garg
2021-03-17 21:55                   ` [PATCH] objtool,static_call: " Jarkko Sakkinen
2021-03-17 21:55                     ` [PATCH] objtool, static_call: " Jarkko Sakkinen
2021-03-18  4:42                     ` [PATCH] objtool,static_call: " Sumit Garg
2021-03-18  4:42                       ` [PATCH] objtool, static_call: " Sumit Garg
2021-03-17 21:01                 ` [PATCH] objtool,static_call: " Jarkko Sakkinen
2021-03-17 21:01                   ` [PATCH] objtool, static_call: " Jarkko Sakkinen
2021-03-18  0:02                 ` [PATCH] objtool,static_call: " Josh Poimboeuf
2021-03-18  0:02                   ` [PATCH] objtool, static_call: " Josh Poimboeuf
2021-03-18  7:59                   ` [PATCH] objtool,static_call: " Peter Zijlstra
2021-03-18  7:59                     ` [PATCH] objtool, static_call: " Peter Zijlstra
2021-03-18  8:30                     ` [PATCH] objtool,static_call: " Peter Zijlstra
2021-03-18  8:30                       ` [PATCH] objtool, static_call: " Peter Zijlstra
2021-03-18  8:47                       ` [PATCH] objtool,static_call: " Peter Zijlstra
2021-03-18  8:47                         ` [PATCH] objtool, static_call: " Peter Zijlstra
2021-03-17 21:00               ` [KEYS] 4a00e5e212: WARNING:at_arch/x86/kernel/static_call.c:#__static_call_validate Jarkko Sakkinen
2021-03-18 10:25         ` Peter Zijlstra
2021-03-18 11:03           ` Sumit Garg

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=YFHFjarVo7HAP7pg@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=lkp@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.