linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: avoid warning for zero-filling .bss
@ 2016-11-16 14:17 Arnd Bergmann
  2016-11-17  7:19 ` [tip:x86/urgent] x86/boot: Avoid " tip-bot for Arnd Bergmann
  2016-11-17 21:02 ` [PATCH] x86: avoid " Josh Poimboeuf
  0 siblings, 2 replies; 7+ messages in thread
From: Arnd Bergmann @ 2016-11-16 14:17 UTC (permalink / raw)
  To: x86
  Cc: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Andy Lutomirski, Josh Poimboeuf, linux-kernel

The latest binutils are warning about a .fill directive with an explicit
value in a .bss section:

arch/x86/kernel/head_32.S: Assembler messages:
arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in section `.bss..page_aligned'
arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in section `.bss..page_aligned'

This comes from the 'ENTRY()' macro padding the space between the symbols
with 'nop'. Open-coding the .globl directive without the padding
avoids that warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kernel/head_32.S | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index df541ac2071e..4e8577d03372 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -669,14 +669,17 @@ __PAGE_ALIGNED_BSS
 initial_pg_pmd:
 	.fill 1024*KPMDS,4,0
 #else
-ENTRY(initial_page_table)
+.globl initial_page_table
+initial_page_table:
 	.fill 1024,4,0
 #endif
 initial_pg_fixmap:
 	.fill 1024,4,0
-ENTRY(empty_zero_page)
+.globl empty_zero_page
+empty_zero_page:
 	.fill 4096,1,0
-ENTRY(swapper_pg_dir)
+.globl swapper_pg_dir
+swapper_pg_dir:
 	.fill 1024,4,0
 EXPORT_SYMBOL(empty_zero_page)
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip:x86/urgent] x86/boot: Avoid warning for zero-filling .bss
  2016-11-16 14:17 [PATCH] x86: avoid warning for zero-filling .bss Arnd Bergmann
@ 2016-11-17  7:19 ` tip-bot for Arnd Bergmann
  2016-11-17 21:02 ` [PATCH] x86: avoid " Josh Poimboeuf
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Arnd Bergmann @ 2016-11-17  7:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: peterz, jpoimboe, dvlasenk, bp, linux-kernel, torvalds, luto,
	tglx, brgerst, hpa, mingo, arnd

Commit-ID:  553bbc11aa6c1f9e0f529a06aeeca15fbe4a3985
Gitweb:     http://git.kernel.org/tip/553bbc11aa6c1f9e0f529a06aeeca15fbe4a3985
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Wed, 16 Nov 2016 15:17:09 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 17 Nov 2016 07:34:58 +0100

x86/boot: Avoid warning for zero-filling .bss

The latest binutils are warning about a .fill directive with an explicit
value in a .bss section:

  arch/x86/kernel/head_32.S: Assembler messages:
  arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in section `.bss..page_aligned'
  arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in section `.bss..page_aligned'

This comes from the 'ENTRY()' macro padding the space between the symbols
with 'nop' via:

  .align 4,0x90

Open-coding the .globl directive without the padding avoids that warning,
as all the symbols are already page aligned.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161116141726.2013389-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/head_32.S | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index b6b2f02..2dabea4 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -665,14 +665,17 @@ __PAGE_ALIGNED_BSS
 initial_pg_pmd:
 	.fill 1024*KPMDS,4,0
 #else
-ENTRY(initial_page_table)
+.globl initial_page_table
+initial_page_table:
 	.fill 1024,4,0
 #endif
 initial_pg_fixmap:
 	.fill 1024,4,0
-ENTRY(empty_zero_page)
+.globl empty_zero_page
+empty_zero_page:
 	.fill 4096,1,0
-ENTRY(swapper_pg_dir)
+.globl swapper_pg_dir
+swapper_pg_dir:
 	.fill 1024,4,0
 EXPORT_SYMBOL(empty_zero_page)
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: avoid warning for zero-filling .bss
  2016-11-16 14:17 [PATCH] x86: avoid warning for zero-filling .bss Arnd Bergmann
  2016-11-17  7:19 ` [tip:x86/urgent] x86/boot: Avoid " tip-bot for Arnd Bergmann
@ 2016-11-17 21:02 ` Josh Poimboeuf
  2016-11-17 21:19   ` hpa
  2016-11-17 22:32   ` Arnd Bergmann
  1 sibling, 2 replies; 7+ messages in thread
From: Josh Poimboeuf @ 2016-11-17 21:02 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: x86, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Andy Lutomirski, linux-kernel

On Wed, Nov 16, 2016 at 03:17:09PM +0100, Arnd Bergmann wrote:
> The latest binutils are warning about a .fill directive with an explicit
> value in a .bss section:
> 
> arch/x86/kernel/head_32.S: Assembler messages:
> arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in section `.bss..page_aligned'
> arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in section `.bss..page_aligned'
> 
> This comes from the 'ENTRY()' macro padding the space between the symbols
> with 'nop'. Open-coding the .globl directive without the padding
> avoids that warning.

How is there space between the symbols?  Aren't they already aligned?

Isn't the warning really about the fact that it's unnecessarily filling
a .bss section with zeros?  Would it make sense to use .align instead?

> ---
>  arch/x86/kernel/head_32.S | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
> index df541ac2071e..4e8577d03372 100644
> --- a/arch/x86/kernel/head_32.S
> +++ b/arch/x86/kernel/head_32.S
> @@ -669,14 +669,17 @@ __PAGE_ALIGNED_BSS
>  initial_pg_pmd:
>  	.fill 1024*KPMDS,4,0
>  #else
> -ENTRY(initial_page_table)
> +.globl initial_page_table
> +initial_page_table:
>  	.fill 1024,4,0
>  #endif
>  initial_pg_fixmap:
>  	.fill 1024,4,0
> -ENTRY(empty_zero_page)
> +.globl empty_zero_page
> +empty_zero_page:
>  	.fill 4096,1,0
> -ENTRY(swapper_pg_dir)
> +.globl swapper_pg_dir
> +swapper_pg_dir:
>  	.fill 1024,4,0
>  EXPORT_SYMBOL(empty_zero_page)
>  
> -- 
> 2.9.0
> 

-- 
Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: avoid warning for zero-filling .bss
  2016-11-17 21:02 ` [PATCH] x86: avoid " Josh Poimboeuf
@ 2016-11-17 21:19   ` hpa
  2016-11-17 22:32   ` Arnd Bergmann
  1 sibling, 0 replies; 7+ messages in thread
From: hpa @ 2016-11-17 21:19 UTC (permalink / raw)
  To: Josh Poimboeuf, Arnd Bergmann
  Cc: x86, Thomas Gleixner, Ingo Molnar, Andy Lutomirski, linux-kernel

On November 17, 2016 1:02:48 PM PST, Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>On Wed, Nov 16, 2016 at 03:17:09PM +0100, Arnd Bergmann wrote:
>> The latest binutils are warning about a .fill directive with an
>explicit
>> value in a .bss section:
>> 
>> arch/x86/kernel/head_32.S: Assembler messages:
>> arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in
>section `.bss..page_aligned'
>> arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in
>section `.bss..page_aligned'
>> 
>> This comes from the 'ENTRY()' macro padding the space between the
>symbols
>> with 'nop'. Open-coding the .globl directive without the padding
>> avoids that warning.
>
>How is there space between the symbols?  Aren't they already aligned?
>
>Isn't the warning really about the fact that it's unnecessarily filling
>a .bss section with zeros?  Would it make sense to use .align instead?
>
>> ---
>>  arch/x86/kernel/head_32.S | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>> 
>> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
>> index df541ac2071e..4e8577d03372 100644
>> --- a/arch/x86/kernel/head_32.S
>> +++ b/arch/x86/kernel/head_32.S
>> @@ -669,14 +669,17 @@ __PAGE_ALIGNED_BSS
>>  initial_pg_pmd:
>>  	.fill 1024*KPMDS,4,0
>>  #else
>> -ENTRY(initial_page_table)
>> +.globl initial_page_table
>> +initial_page_table:
>>  	.fill 1024,4,0
>>  #endif
>>  initial_pg_fixmap:
>>  	.fill 1024,4,0
>> -ENTRY(empty_zero_page)
>> +.globl empty_zero_page
>> +empty_zero_page:
>>  	.fill 4096,1,0
>> -ENTRY(swapper_pg_dir)
>> +.globl swapper_pg_dir
>> +swapper_pg_dir:
>>  	.fill 1024,4,0
>>  EXPORT_SYMBOL(empty_zero_page)
>>  
>> -- 
>> 2.9.0
>> 

Use .org, .align, or .space
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: avoid warning for zero-filling .bss
  2016-11-17 21:02 ` [PATCH] x86: avoid " Josh Poimboeuf
  2016-11-17 21:19   ` hpa
@ 2016-11-17 22:32   ` Arnd Bergmann
  2016-11-17 22:44     ` Josh Poimboeuf
  1 sibling, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2016-11-17 22:32 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Andy Lutomirski, linux-kernel

On Thursday, November 17, 2016 3:02:48 PM CET Josh Poimboeuf wrote:
> On Wed, Nov 16, 2016 at 03:17:09PM +0100, Arnd Bergmann wrote:
> > The latest binutils are warning about a .fill directive with an explicit
> > value in a .bss section:
> > 
> > arch/x86/kernel/head_32.S: Assembler messages:
> > arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in section `.bss..page_aligned'
> > arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in section `.bss..page_aligned'
> > 
> > This comes from the 'ENTRY()' macro padding the space between the symbols
> > with 'nop'. Open-coding the .globl directive without the padding
> > avoids that warning.
> 
> How is there space between the symbols?  Aren't they already aligned?

My understanding is that they are aligned, it's just that gas complains
about the .align directive with a nonzero fill value.

> Isn't the warning really about the fact that it's unnecessarily filling
> a .bss section with zeros?  Would it make sense to use .align instead?

Filling with zeroes is allowed, and that's what we are intending anyway.
.align would not do the right thing here as it only adds padding if it's
not already aligned, but we know it is.

	Arnd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: avoid warning for zero-filling .bss
  2016-11-17 22:32   ` Arnd Bergmann
@ 2016-11-17 22:44     ` Josh Poimboeuf
  2016-11-18  0:07       ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Poimboeuf @ 2016-11-17 22:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: x86, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Andy Lutomirski, linux-kernel

On Thu, Nov 17, 2016 at 11:32:30PM +0100, Arnd Bergmann wrote:
> On Thursday, November 17, 2016 3:02:48 PM CET Josh Poimboeuf wrote:
> > On Wed, Nov 16, 2016 at 03:17:09PM +0100, Arnd Bergmann wrote:
> > > The latest binutils are warning about a .fill directive with an explicit
> > > value in a .bss section:
> > > 
> > > arch/x86/kernel/head_32.S: Assembler messages:
> > > arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in section `.bss..page_aligned'
> > > arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in section `.bss..page_aligned'
> > > 
> > > This comes from the 'ENTRY()' macro padding the space between the symbols
> > > with 'nop'. Open-coding the .globl directive without the padding
> > > avoids that warning.
> > 
> > How is there space between the symbols?  Aren't they already aligned?
> 
> My understanding is that they are aligned, it's just that gas complains
> about the .align directive with a nonzero fill value.

Ah, I see now.  In that case your patch looks fine to me.

Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>

> 
> > Isn't the warning really about the fact that it's unnecessarily filling
> > a .bss section with zeros?  Would it make sense to use .align instead?
> 
> Filling with zeroes is allowed, and that's what we are intending anyway.
> .align would not do the right thing here as it only adds padding if it's
> not already aligned, but we know it is.

-- 
Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86: avoid warning for zero-filling .bss
  2016-11-17 22:44     ` Josh Poimboeuf
@ 2016-11-18  0:07       ` H. Peter Anvin
  0 siblings, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2016-11-18  0:07 UTC (permalink / raw)
  To: Josh Poimboeuf, Arnd Bergmann
  Cc: x86, Thomas Gleixner, Ingo Molnar, Andy Lutomirski, linux-kernel

On 11/17/16 14:44, Josh Poimboeuf wrote:
> On Thu, Nov 17, 2016 at 11:32:30PM +0100, Arnd Bergmann wrote:
>> On Thursday, November 17, 2016 3:02:48 PM CET Josh Poimboeuf wrote:
>>> On Wed, Nov 16, 2016 at 03:17:09PM +0100, Arnd Bergmann wrote:
>>>> The latest binutils are warning about a .fill directive with an explicit
>>>> value in a .bss section:
>>>>
>>>> arch/x86/kernel/head_32.S: Assembler messages:
>>>> arch/x86/kernel/head_32.S:677: Warning: ignoring fill value in section `.bss..page_aligned'
>>>> arch/x86/kernel/head_32.S:679: Warning: ignoring fill value in section `.bss..page_aligned'
>>>>
>>>> This comes from the 'ENTRY()' macro padding the space between the symbols
>>>> with 'nop'. Open-coding the .globl directive without the padding
>>>> avoids that warning.
>>>
>>> How is there space between the symbols?  Aren't they already aligned?
>>
>> My understanding is that they are aligned, it's just that gas complains
>> about the .align directive with a nonzero fill value.
> 
> Ah, I see now.  In that case your patch looks fine to me.
> 

Yes, ENTRY() is for code.

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-18  0:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 14:17 [PATCH] x86: avoid warning for zero-filling .bss Arnd Bergmann
2016-11-17  7:19 ` [tip:x86/urgent] x86/boot: Avoid " tip-bot for Arnd Bergmann
2016-11-17 21:02 ` [PATCH] x86: avoid " Josh Poimboeuf
2016-11-17 21:19   ` hpa
2016-11-17 22:32   ` Arnd Bergmann
2016-11-17 22:44     ` Josh Poimboeuf
2016-11-18  0:07       ` H. Peter Anvin

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).