2023-02-16 03:40:42

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the powerpc tree

Hi all,

After merging the powerpc tree, today's linux-next build (powerpc
pseries_le_defconfig) produced this warning:

arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128: unannotated intra-function call

I have no idea what caused this.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (488.00 B)
OpenPGP digital signature

2023-02-16 18:06:30

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the powerpc tree

On Thu, Feb 16, 2023 at 02:40:31PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the powerpc tree, today's linux-next build (powerpc
> pseries_le_defconfig) produced this warning:
>
> arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128: unannotated intra-function call
>
> I have no idea what caused this.

Adding Sathvika and Christophe.

The short term fix would be something like the below, but...

If powerpc objtool is only doing mcount, does it even make sense to run
objtool on asm files? If so, there are probably a lot more cleanups
needed for the asm code.

So I'm thinking either we should cleanup all the powerpc asm code with
annotations like below, or we should try to make objtool mcount-mode
ignore asm files.


diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 3a7266fa8a18..1febb56ebaeb 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -472,7 +472,7 @@ SYM_FUNC_START_LOCAL(__mmu_off)
b . /* prevent speculative execution */
SYM_FUNC_END(__mmu_off)

-start_initialization_book3s:
+SYM_FUNC_START_LOCAL(start_initialization_book3s)
mflr r25

/* Setup some critical 970 SPRs before switching MMU off */
@@ -494,6 +494,7 @@ start_initialization_book3s:

mtlr r25
blr
+SYM_FUNC_END(start_initialization_book3s)
#endif

/*

2023-02-17 01:35:31

by Michael Ellerman

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the powerpc tree

Josh Poimboeuf <[email protected]> writes:
> On Thu, Feb 16, 2023 at 02:40:31PM +1100, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the powerpc tree, today's linux-next build (powerpc
>> pseries_le_defconfig) produced this warning:
>>
>> arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128: unannotated intra-function call
>>
>> I have no idea what caused this.
>
> Adding Sathvika and Christophe.
>
> The short term fix would be something like the below, but...
>
> If powerpc objtool is only doing mcount, does it even make sense to run
> objtool on asm files? If so, there are probably a lot more cleanups
> needed for the asm code.

I would like to enable more of the objtool checks eventually, although I
don't have a timeline for that. But I'd prefer to keep checking the asm
code seeing as we've already enabled that.

> So I'm thinking either we should cleanup all the powerpc asm code with
> annotations like below, or we should try to make objtool mcount-mode
> ignore asm files.

I think we have most of the code annotated already, this is a new
warning because that code is newly refactored by a commit I applied.

I'll have to fix my build scripts to error out on objtool warnings.

cheers


> diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
> index 3a7266fa8a18..1febb56ebaeb 100644
> --- a/arch/powerpc/kernel/head_64.S
> +++ b/arch/powerpc/kernel/head_64.S
> @@ -472,7 +472,7 @@ SYM_FUNC_START_LOCAL(__mmu_off)
> b . /* prevent speculative execution */
> SYM_FUNC_END(__mmu_off)
>
> -start_initialization_book3s:
> +SYM_FUNC_START_LOCAL(start_initialization_book3s)
> mflr r25
>
> /* Setup some critical 970 SPRs before switching MMU off */
> @@ -494,6 +494,7 @@ start_initialization_book3s:
>
> mtlr r25
> blr
> +SYM_FUNC_END(start_initialization_book3s)
> #endif
>
> /*

2023-02-17 07:05:59

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the powerpc tree

On Fri, Feb 17, 2023 at 12:35:17PM +1100, Michael Ellerman wrote:
> Josh Poimboeuf <[email protected]> writes:
> > On Thu, Feb 16, 2023 at 02:40:31PM +1100, Stephen Rothwell wrote:
> >> Hi all,
> >>
> >> After merging the powerpc tree, today's linux-next build (powerpc
> >> pseries_le_defconfig) produced this warning:
> >>
> >> arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128: unannotated intra-function call
> >>
> >> I have no idea what caused this.
> >
> > Adding Sathvika and Christophe.
> >
> > The short term fix would be something like the below, but...
> >
> > If powerpc objtool is only doing mcount, does it even make sense to run
> > objtool on asm files? If so, there are probably a lot more cleanups
> > needed for the asm code.
>
> I would like to enable more of the objtool checks eventually, although I
> don't have a timeline for that. But I'd prefer to keep checking the asm
> code seeing as we've already enabled that.

Sounds good for now, though as you get more objtool features there will
need to be more changes.

For example a lot of the callable functions are annotated with _GLOBAL()
rather than SYM_FUNC_{START,END}. The latter adds the function size,
which objtool needs in several cases. It also has particular rules
about when to use SYM_FUNC_* vs SYM_CODE_*, etc to make the code more
structured.

> > So I'm thinking either we should cleanup all the powerpc asm code with
> > annotations like below, or we should try to make objtool mcount-mode
> > ignore asm files.
>
> I think we have most of the code annotated already, this is a new
> warning because that code is newly refactored by a commit I applied.
>
> I'll have to fix my build scripts to error out on objtool warnings.

Likewise, I'll need to add some powerpc cross-compiles to my testing.

If we get too many of these powerpc warnings, we may be looking to
recruit more objtool maintainers ;-)

--
Josh