linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	PowerPC <linuxppc-dev@lists.ozlabs.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	"peterz@infradead.org" <peterz@infradead.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Sathvika Vasireddy <sv@linux.ibm.com>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: build warnings after merge of the powerpc-objtool tree
Date: Tue, 06 Dec 2022 15:44:22 +0530	[thread overview]
Message-ID: <1670317359.hj45ajyl9d.naveen@linux.ibm.com> (raw)
In-Reply-To: <74552090-c654-5356-773d-47ead2d63ab2@linux.ibm.com>

Sathvika Vasireddy wrote:
> 
> On 29/11/22 20:58, Christophe Leroy wrote:
>>
>> Le 29/11/2022 à 16:13, Sathvika Vasireddy a écrit :
>>> Hi all,
>>>
>>> On 25/11/22 09:00, Stephen Rothwell wrote:
>>>> Hi all,
>>>>
>>>> After merging the powerpc-objtool tree, today's linux-next build (powerpc
>>>> pseries_le_defconfig) produced these warnings:
>>>>
>>>> arch/powerpc/kernel/head_64.o: warning: objtool: end_first_256B():
>>>> can't find starting instruction
>>>> arch/powerpc/kernel/optprobes_head.o: warning: objtool:
>>>> optprobe_template_end(): can't find starting instruction
>>>>
>>>> I have no idea what started this (they may have been there yesterday).
>>> I was able to recreate the above mentioned warnings with
>>> pseries_le_defconfig and powernv_defconfig. The regression report also
>>> mentions a warning
>>> (https://lore.kernel.org/oe-kbuild-all/202211282102.QUr7HHrW-lkp@intel.com/) seen with arch/powerpc/kernel/kvm_emul.S assembly file.
>>>
>>>    [1] arch/powerpc/kernel/optprobes_head.o: warning: objtool:
>>> optprobe_template_end(): can't find starting instruction
>>>    [2] arch/powerpc/kernel/kvm_emul.o: warning: objtool:
>>> kvm_template_end(): can't find starting instruction
>>>    [3] arch/powerpc/kernel/head_64.o: warning: objtool: end_first_256B():
>>> can't find starting instruction
>>>
>>> The warnings [1] and [2] go away after adding 'nop' instruction. Below
>>> diff fixes it for me:
>> You have to add NOPs just because those labels are at the end of the
>> files. That's a bit odd.
>> I think either we are missing some kind of flagging for the symbols, or
>> objtool has a bug. In both cases, I'm not sure adding an artificial
>> 'nop' is the solution. At least there should be a big hammer warning
>> explaining why.

The problem looks to be that commit dbcdbdfdf137b4 ("objtool: Rework 
instruction -> symbol mapping"), which was referenced by Sathvika below, 
changes how STT_NOTYPE symbols are handled. In the files throwing that 
warning, there are labels either at the very end of the file, or at the 
end of a section with no subsequent instruction. Before that commit, we 
didn't used to expect an instruction for STT_NOTYPE symbols.

> 
> I don't see these warnings with powerpc/topic/objtool branch. However, 
> they are seen with linux-next master branch.
> Commit dbcdbdfdf137b49144204571f1a5e5dc01b8aaad objtool: Rework 
> instruction -> symbol mapping in linux-next is resulting in objtool 
> can't find starting instruction warnings on powerpc.
> 
> Reverting this particular hunk (pasted below), resolves it and we don't 
> see the problem anymore.
> 
> @@ -427,7 +427,10 @@ static int decode_instructions(struct objtool_file 
> *file)
>                  }
> 
>                  list_for_each_entry(func, &sec->symbol_list, list) {
> -                       if (func->type != STT_FUNC || func->alias != func)
> +                       if (func->type != STT_NOTYPE && func->type != 
> STT_FUNC)
> +                               continue;
> +
> +                       if (func->return_thunk || func->alias != func)
>                                  continue;
> 
>                          if (!find_insn(file, sec, func->offset)) {

We are currently bailing out if find_insn() there fails. Should we 
instead just continue by not setting insn->sym?

@@ -430,11 +430,8 @@ static int decode_instructions(struct objtool_file *file)
                        if (func->return_thunk || func->alias != func)
                                continue;
 
-                       if (!find_insn(file, sec, func->offset)) {
-                               WARN("%s(): can't find starting instruction",
-                                    func->name);
-                               return -1;
-                       }
+                       if (!find_insn(file, sec, func->offset))
+                               continue;
 
                        sym_for_each_insn(file, func, insn) {
                                insn->sym = func;



- Naveen


      reply	other threads:[~2022-12-06 10:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  3:30 linux-next: build warnings after merge of the powerpc-objtool tree Stephen Rothwell
2022-11-29 15:13 ` Sathvika Vasireddy
2022-11-29 15:28   ` Christophe Leroy
2022-11-30 11:51     ` Sathvika Vasireddy
2022-12-06 10:14       ` Naveen N. Rao [this message]

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=1670317359.hj45ajyl9d.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=sv@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).