public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: Build Warnings at arch/powerpc/
Date: Tue, 4 Mar 2025 18:33:08 +0530	[thread overview]
Message-ID: <988cb994-d8b1-4688-b926-66507ebe90df@linux.ibm.com> (raw)
In-Reply-To: <fe937273-d81a-4f6c-9eba-b96b711b4644@linux.ibm.com>


On 04/03/25 6:08 pm, Madhavan Srinivasan wrote:
>
> On 3/4/25 4:58 PM, Madhavan Srinivasan wrote:
>>
>> On 3/4/25 2:26 PM, Christophe Leroy wrote:
>>>
>>> Le 04/03/2025 à 07:13, Madhavan Srinivasan a écrit :
>>>>
>>>> On 3/4/25 10:42 AM, Venkat Rao Bagalkote wrote:
>>>>> Greetings!!
>>>>>
>>>>>
>>>>> Observing build warnings with linux-next and powerpc repo's. Issue is currently not seen on mainline yet.
>>>>>
>>>>> PPC Repo: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fpowerpc%2Flinux.git&data=05%7C02%7Cchristophe.leroy2%40cs-soprasteria.com%7C8e0f8501f09c48dbb43608dd5ae3c9bf%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638766656585342184%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=e5BrJzcrtlITkLF31KltGExQ5Qe8fDVTMV6VfR4w9o8%3D&reserved=0 merge branch
>>>>>
>>>>> PPC Kernel Version: 6.14.0-rc4-g1304f486dbf1
>>>>> next Repo: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fnext%2Flinux-next.git&data=05%7C02%7Cchristophe.leroy2%40cs-soprasteria.com%7C8e0f8501f09c48dbb43608dd5ae3c9bf%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C638766656585355246%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=meQyZfB75HhJFCL6AX93slsyVwnogGPYFabDXl%2FLzDA%3D&reserved=0 master branch
>>>>>
>>>>> next Kernel Version: 6.14.0-rc5-next-20250303
>>>>>
>>>>>
>>>>> On linux-next kernel issue got introduced b/w next-20250227 and next-20250303
>>>>>
>>>>>
>>>>> Build Warnings:
>>>>>
>>>>> arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xe84: intra_function_call not a direct call
>>>>> arch/powerpc/crypto/ghashp8-ppc.o: warning: objtool: .text+0x22c: unannotated intra-function call
>>>>> arch/powerpc/kernel/switch.o: warning: objtool: .text+0x4: intra_function_call not a direct call
>>>>>
>>>>>
>>>> Can you please specific the compiler and compiler version you found this issue with
>>>>
>>> Can you also tell which defconfig you are using or provide your .config
>>>
>>> It might also be helpfull if you can provide a disassembly of the three file.o around the warned address.
>> I could recreate the issue with gcc 11.4.1 20231218 with today's linux-next (but could not recreate with gcc 14 or gcc 11.3.0)
>>
>> (20d5c66e1810 (HEAD -> master, tag: next-20250304, origin/master, origin/HEAD) Add linux-next specific files for 20250304)
>>
>> warning for one of the switch.S file :
>>
>>    CC      arch/powerpc/kernel/syscalls.o
>>    AS      arch/powerpc/kernel/switch.o
>> arch/powerpc/kernel/switch.o: warning: objtool: .text+0x4: intra_function_call not a direct call
> I guess this is becos, for bl .+4, we recently added in the arch_decode_instruction (decode.c) to set the type as INSN_OTHER
>
>          case 18: /* b[l][a] */
>                  if (ins == 0x48000005)  /* bl .+4 */
>                          typ = INSN_OTHER;
>
> Which I think is the issue here, changing it to INSN_CALL from INSN_OTHER fixes the warning
>
> diff --git a/tools/objtool/arch/powerpc/decode.c b/tools/objtool/arch/powerpc/decode.c
> index 26d5050424a9..ffd63a61a585 100644
> --- a/tools/objtool/arch/powerpc/decode.c
> +++ b/tools/objtool/arch/powerpc/decode.c
> @@ -56,7 +56,7 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
>          switch (opcode) {
>          case 18: /* b[l][a] */
>                  if (ins == 0x48000005)  /* bl .+4 */
> -                       typ = INSN_OTHER;
> +                       typ = INSN_CALL;
>                  else if (ins & 1)       /* bl[a] */
>                          typ = INSN_CALL;
>                  else            /* b[a] */
>
>
> Maddy
>
Maddy,

I changed the code manually and gave it a try. The Proposed fix, 
partially fixes the issue. It gets rid of two of the warnings, but below 
warning still persists.

arch/powerpc/crypto/ghashp8-ppc.o: warning: objtool: .text+0x22c: 
unannotated intra-function call

>>    CC      arch/powerpc/kernel/irq.o
>>    CC      arch/powerpc/kernel/align.o
>>    CC      arch/powerpc/kernel/signal_64.o
>>
>> Objdump of switch.o:
>> arch/powerpc/kernel/switch.o:     file format elf64-powerpcle
>>
>> Disassembly of section .text:
>>
>> 0000000000000000 <flush_branch_caches>:
>>         0:	a6 02 28 7d 	mflr    r9
>>         4:	05 00 00 48 	bl      8 <flush_branch_caches+0x8>
>>         8:	05 00 00 48 	bl      c <flush_branch_caches+0xc>
>>         c:	05 00 00 48 	bl      10 <flush_branch_caches+0x10>
>>        10:	05 00 00 48 	bl      14 <flush_branch_caches+0x14>
>>        14:	05 00 00 48 	bl      18 <flush_branch_caches+0x18>
>>        18:	05 00 00 48 	bl      1c <flush_branch_caches+0x1c>
>>        1c:	05 00 00 48 	bl      20 <flush_branch_caches+0x20>
>>        20:	05 00 00 48 	bl      24 <flush_branch_caches+0x24>
>>        24:	05 00 00 48 	bl      28 <flush_branch_caches+0x28>
>>        28:	05 00 00 48 	bl      2c <flush_branch_caches+0x2c>
>>
>>
>> arch/powerpc/kernel/switch.S failing src section:
>>
>> .balign 32
>> .global flush_branch_caches
>> flush_branch_caches:
>>          /* Save LR into r9 */
>>          mflr    r9
>>
>>          // Flush the link stack
>>          .rept 64
>>          ANNOTATE_INTRA_FUNCTION_CALL
>>          bl      .+4
>>          .endr
>>          b       1f
>>          nops    6
>>
>> Maddy
>>
>>
>>> Christophe
>>
>
Regards,

Venkat.


  reply	other threads:[~2025-03-04 13:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04  5:12 Build Warnings at arch/powerpc/ Venkat Rao Bagalkote
2025-03-04  6:13 ` Madhavan Srinivasan
2025-03-04  8:56   ` Christophe Leroy
2025-03-04 11:28     ` Madhavan Srinivasan
2025-03-04 12:38       ` Madhavan Srinivasan
2025-03-04 13:03         ` Venkat Rao Bagalkote [this message]
2025-03-04 13:13           ` Christophe Leroy
2025-03-04 15:44             ` Venkat Rao Bagalkote
2025-03-04 17:17               ` Christophe Leroy
2025-03-04 13:06         ` Christophe Leroy
2025-03-04 11:41   ` Venkat Rao Bagalkote

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=988cb994-d8b1-4688-b926-66507ebe90df@linux.ibm.com \
    --to=venkat88@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=sfr@canb.auug.org.au \
    /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