* [PATCH] powerpc: Fix 'intra_function_call not a direct call' warning
@ 2025-03-04 23:00 Christophe Leroy
2025-03-05 4:04 ` Venkat Rao Bagalkote
2025-03-14 3:46 ` Madhavan Srinivasan
0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy @ 2025-03-04 23:00 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Naveen N Rao, Madhavan Srinivasan
Cc: Christophe Leroy, linux-kernel, linuxppc-dev, Venkat Rao Bagalkote
The following build warning have been reported:
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xe84: intra_function_call not a direct call
arch/powerpc/kernel/switch.o: warning: objtool: .text+0x4: intra_function_call not a direct call
This happens due to commit bb7f054f4de2 ("objtool/powerpc: Add support
for decoding all types of uncond branches") because that commit decodes
'bl .+4' as a normal instruction because that instruction is used by
clang instead of 'bcl 20,31,+.4' for relocatable code.
The solution is simply to remove the ANNOTATE_INTRA_FUNCTION_CALL
annotation now that the instruction is not seen as a function call
anymore.
Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Closes: https://lore.kernel.org/all/8c4c3fc2-2bd7-4148-af68-2f504d6119e0@linux.ibm.com
Fixes: bb7f054f4de2 ("objtool/powerpc: Add support for decoding all types of uncond branches")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/kernel/switch.S | 1 -
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 --
2 files changed, 3 deletions(-)
diff --git a/arch/powerpc/kernel/switch.S b/arch/powerpc/kernel/switch.S
index 608c0ce7cec6..59e3ee99db0e 100644
--- a/arch/powerpc/kernel/switch.S
+++ b/arch/powerpc/kernel/switch.S
@@ -39,7 +39,6 @@ flush_branch_caches:
// Flush the link stack
.rept 64
- ANNOTATE_INTRA_FUNCTION_CALL
bl .+4
.endr
b 1f
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index ea7ad200b330..83f7504349d2 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1524,14 +1524,12 @@ kvm_flush_link_stack:
/* Flush the link stack. On Power8 it's up to 32 entries in size. */
.rept 32
- ANNOTATE_INTRA_FUNCTION_CALL
bl .+4
.endr
/* And on Power9 it's up to 64. */
BEGIN_FTR_SECTION
.rept 32
- ANNOTATE_INTRA_FUNCTION_CALL
bl .+4
.endr
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
--
2.47.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc: Fix 'intra_function_call not a direct call' warning
2025-03-04 23:00 [PATCH] powerpc: Fix 'intra_function_call not a direct call' warning Christophe Leroy
@ 2025-03-05 4:04 ` Venkat Rao Bagalkote
2025-03-14 3:46 ` Madhavan Srinivasan
1 sibling, 0 replies; 3+ messages in thread
From: Venkat Rao Bagalkote @ 2025-03-05 4:04 UTC (permalink / raw)
To: Christophe Leroy, Michael Ellerman, Nicholas Piggin,
Naveen N Rao, Madhavan Srinivasan
Cc: linux-kernel, linuxppc-dev
Hello Christophe,
On 05/03/25 4:30 am, Christophe Leroy wrote:
> The following build warning have been reported:
>
> arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xe84: intra_function_call not a direct call
> arch/powerpc/kernel/switch.o: warning: objtool: .text+0x4: intra_function_call not a direct call
>
> This happens due to commit bb7f054f4de2 ("objtool/powerpc: Add support
> for decoding all types of uncond branches") because that commit decodes
> 'bl .+4' as a normal instruction because that instruction is used by
> clang instead of 'bcl 20,31,+.4' for relocatable code.
>
> The solution is simply to remove the ANNOTATE_INTRA_FUNCTION_CALL
> annotation now that the instruction is not seen as a function call
> anymore.
>
> Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> Closes: https://lore.kernel.org/all/8c4c3fc2-2bd7-4148-af68-2f504d6119e0@linux.ibm.com
> Fixes: bb7f054f4de2 ("objtool/powerpc: Add support for decoding all types of uncond branches")
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/kernel/switch.S | 1 -
> arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 --
> 2 files changed, 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/switch.S b/arch/powerpc/kernel/switch.S
> index 608c0ce7cec6..59e3ee99db0e 100644
> --- a/arch/powerpc/kernel/switch.S
> +++ b/arch/powerpc/kernel/switch.S
> @@ -39,7 +39,6 @@ flush_branch_caches:
>
> // Flush the link stack
> .rept 64
> - ANNOTATE_INTRA_FUNCTION_CALL
> bl .+4
> .endr
> b 1f
> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> index ea7ad200b330..83f7504349d2 100644
> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> @@ -1524,14 +1524,12 @@ kvm_flush_link_stack:
>
> /* Flush the link stack. On Power8 it's up to 32 entries in size. */
> .rept 32
> - ANNOTATE_INTRA_FUNCTION_CALL
> bl .+4
> .endr
>
> /* And on Power9 it's up to 64. */
> BEGIN_FTR_SECTION
> .rept 32
> - ANNOTATE_INTRA_FUNCTION_CALL
> bl .+4
> .endr
> END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
Applied this patch on top of linux-next 20250303, and it fixes the below
reported warning.
arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xe84: intra_function_call not a direct call
arch/powerpc/kernel/switch.o: warning: objtool: .text+0x4: intra_function_call not a direct call
Please add below tag:
Tested-By: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Regards,
Venkat.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] powerpc: Fix 'intra_function_call not a direct call' warning
2025-03-04 23:00 [PATCH] powerpc: Fix 'intra_function_call not a direct call' warning Christophe Leroy
2025-03-05 4:04 ` Venkat Rao Bagalkote
@ 2025-03-14 3:46 ` Madhavan Srinivasan
1 sibling, 0 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2025-03-14 3:46 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Naveen N Rao, Christophe Leroy
Cc: linux-kernel, linuxppc-dev, Venkat Rao Bagalkote
On Wed, 05 Mar 2025 00:00:19 +0100, Christophe Leroy wrote:
> The following build warning have been reported:
>
> arch/powerpc/kvm/book3s_hv_rmhandlers.o: warning: objtool: .text+0xe84: intra_function_call not a direct call
> arch/powerpc/kernel/switch.o: warning: objtool: .text+0x4: intra_function_call not a direct call
>
> This happens due to commit bb7f054f4de2 ("objtool/powerpc: Add support
> for decoding all types of uncond branches") because that commit decodes
> 'bl .+4' as a normal instruction because that instruction is used by
> clang instead of 'bcl 20,31,+.4' for relocatable code.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc: Fix 'intra_function_call not a direct call' warning
https://git.kernel.org/powerpc/c/382094a41c706bf9d990a224d5d4d34c02a21f15
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-14 3:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-04 23:00 [PATCH] powerpc: Fix 'intra_function_call not a direct call' warning Christophe Leroy
2025-03-05 4:04 ` Venkat Rao Bagalkote
2025-03-14 3:46 ` Madhavan Srinivasan
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®