linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i386: fix section mismatches for init code with !HOTPLUG_CPU
@ 2009-08-18 15:41 Jan Beulich
  2009-08-18 16:51 ` [tip:x86/urgent] i386: Fix " tip-bot for Jan Beulich
  2009-08-18 17:57 ` [PATCH] i386: fix " Robert Richter
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2009-08-18 15:41 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: robert.richter, linux-kernel

Commit 0e83815be719d3391bf5ea24b7fe696c07dbd417 changed the section the
initial_code variable gets allocated in, in an attempt to address a
section conflict warning. This, however created a new section conflict
when building without HOTPLUG_CPU. The apparently only (reasonable) way
to address this is to always use __REFDATA.

Once at it, also fix a second section mismatch when not using
HOTPLUG_CPU.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Robert Richter <robert.richter@amd.com>

---
 arch/x86/kernel/head_32.S |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--- linux-2.6.31-rc6/arch/x86/kernel/head_32.S	2009-08-18 15:31:16.000000000 +0200
+++ 2.6.31-rc6-i386-head-sections/arch/x86/kernel/head_32.S	2009-08-18 10:38:31.000000000 +0200
@@ -261,9 +261,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
  * which will be freed later
  */
 
-#ifndef CONFIG_HOTPLUG_CPU
-.section .init.text,"ax",@progbits
-#endif
+__CPUINIT
 
 #ifdef CONFIG_SMP
 ENTRY(startup_32_smp)
@@ -602,11 +600,7 @@ ignore_int:
 #endif
 	iret
 
-#ifndef CONFIG_HOTPLUG_CPU
-	__CPUINITDATA
-#else
 	__REFDATA
-#endif
 .align 4
 ENTRY(initial_code)
 	.long i386_start_kernel




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

* [tip:x86/urgent] i386: Fix section mismatches for init code with !HOTPLUG_CPU
  2009-08-18 15:41 [PATCH] i386: fix section mismatches for init code with !HOTPLUG_CPU Jan Beulich
@ 2009-08-18 16:51 ` tip-bot for Jan Beulich
  2009-08-18 17:57 ` [PATCH] i386: fix " Robert Richter
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Jan Beulich @ 2009-08-18 16:51 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, robert.richter, jbeulich, JBeulich,
	tglx, mingo

Commit-ID:  78b89ecd731798f2fec8cc26ca90739253cec33c
Gitweb:     http://git.kernel.org/tip/78b89ecd731798f2fec8cc26ca90739253cec33c
Author:     Jan Beulich <JBeulich@novell.com>
AuthorDate: Tue, 18 Aug 2009 16:41:33 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 18 Aug 2009 17:52:35 +0200

i386: Fix section mismatches for init code with !HOTPLUG_CPU

Commit 0e83815be719d3391bf5ea24b7fe696c07dbd417 changed the
section the initial_code variable gets allocated in, in an
attempt to address a section conflict warning. This, however
created a new section conflict when building without
HOTPLUG_CPU. The apparently only (reasonable) way to address
this is to always use __REFDATA.

Once at it, also fix a second section mismatch when not using
HOTPLUG_CPU.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Robert Richter <robert.richter@amd.com>
LKML-Reference: <4A8AE7CD020000780001054B@vpn.id2.novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/head_32.S |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 0d98a01..cc827ac 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -261,9 +261,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
  * which will be freed later
  */
 
-#ifndef CONFIG_HOTPLUG_CPU
-.section .init.text,"ax",@progbits
-#endif
+__CPUINIT
 
 #ifdef CONFIG_SMP
 ENTRY(startup_32_smp)
@@ -602,11 +600,7 @@ ignore_int:
 #endif
 	iret
 
-#ifndef CONFIG_HOTPLUG_CPU
-	__CPUINITDATA
-#else
 	__REFDATA
-#endif
 .align 4
 ENTRY(initial_code)
 	.long i386_start_kernel

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

* Re: [PATCH] i386: fix section mismatches for init code with !HOTPLUG_CPU
  2009-08-18 15:41 [PATCH] i386: fix section mismatches for init code with !HOTPLUG_CPU Jan Beulich
  2009-08-18 16:51 ` [tip:x86/urgent] i386: Fix " tip-bot for Jan Beulich
@ 2009-08-18 17:57 ` Robert Richter
  2009-08-19  6:28   ` [PATCH] i386: fix section mismatches for init code with!HOTPLUG_CPU Jan Beulich
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Richter @ 2009-08-18 17:57 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, hpa, linux-kernel

On 18.08.09 16:41:33, Jan Beulich wrote:
> Commit 0e83815be719d3391bf5ea24b7fe696c07dbd417 changed the section the
> initial_code variable gets allocated in, in an attempt to address a
> section conflict warning. This, however created a new section conflict
> when building without HOTPLUG_CPU. The apparently only (reasonable) way
> to address this is to always use __REFDATA.

Hmm, not sure if I am missing something, but my patch actually
shouldn't have changed the !HOTPLUG_CPU case:

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 8663afb..0d98a01 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -602,7 +602,11 @@ ignore_int:
 #endif
        iret
 
-.section .cpuinit.data,"wa"
+#ifndef CONFIG_HOTPLUG_CPU
+       __CPUINITDATA
+#else
+       __REFDATA
+#endif
 .align 4
 ENTRY(initial_code)
        .long i386_start_kernel

I compiled -rc6 with HOTPLUG_CPU disabled and got with and without my
patch the following warning:

WARNING: vmlinux.o(.cpuinit.data+0x0): Section mismatch in reference from the variable initial_code to the function .init.text:i386_start_kernel()
The variable __cpuinitdata initial_code references
a function __init i386_start_kernel().
If i386_start_kernel is only used by initial_code then
annotate i386_start_kernel with a matching annotation.

So, the warning was there before.

The problem with that warning is that i386_start_kernel() is in __init
that is calling a chain of other __init functions. Thomas moved
initial_code to __CPUINITDATA (commit 583323b9), and thus, also
i386_start_kernel() should be __cpuinit. But initial_code seems to be
overwritten before with __cpuinit start_secondary() in
smpboot.c. Weird ...

>
> Once at it, also fix a second section mismatch when not using
> HOTPLUG_CPU.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Robert Richter <robert.richter@amd.com>
>
> ---
>  arch/x86/kernel/head_32.S |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> --- linux-2.6.31-rc6/arch/x86/kernel/head_32.S        2009-08-18 15:31:16.000000000 +0200
> +++ 2.6.31-rc6-i386-head-sections/arch/x86/kernel/head_32.S   2009-08-18 10:38:31.000000000 +0200
> @@ -261,9 +261,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
>   * which will be freed later
>   */
>
> -#ifndef CONFIG_HOTPLUG_CPU
> -.section .init.text,"ax",@progbits
> -#endif
> +__CPUINIT

This was here before (HOTPLUG_CPU case):

.section .text.head,"ax",@progbits

In the case a cpu is enabled again, do __cpuinit sections still exist?

-Robert

>
>  #ifdef CONFIG_SMP
>  ENTRY(startup_32_smp)
> @@ -602,11 +600,7 @@ ignore_int:
>  #endif
>       iret
>
> -#ifndef CONFIG_HOTPLUG_CPU
> -     __CPUINITDATA
> -#else
>       __REFDATA
> -#endif
>  .align 4
>  ENTRY(initial_code)
>       .long i386_start_kernel
>
>
>
>

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com


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

* Re: [PATCH] i386: fix section mismatches for init code with!HOTPLUG_CPU
  2009-08-18 17:57 ` [PATCH] i386: fix " Robert Richter
@ 2009-08-19  6:28   ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2009-08-19  6:28 UTC (permalink / raw)
  To: Robert Richter; +Cc: mingo, tglx, linux-kernel, hpa

>>> Robert Richter <robert.richter@amd.com> 18.08.09 19:57 >>>
>On 18.08.09 16:41:33, Jan Beulich wrote:
>> Commit 0e83815be719d3391bf5ea24b7fe696c07dbd417 changed the section the
>> initial_code variable gets allocated in, in an attempt to address a
>> section conflict warning. This, however created a new section conflict
>> when building without HOTPLUG_CPU. The apparently only (reasonable) way
>> to address this is to always use __REFDATA.
>
>Hmm, not sure if I am missing something, but my patch actually
>shouldn't have changed the !HOTPLUG_CPU case:

Correct, but it also didn't take care of it, despite changing the code in
question.

Jan


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

end of thread, other threads:[~2009-08-19  6:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-18 15:41 [PATCH] i386: fix section mismatches for init code with !HOTPLUG_CPU Jan Beulich
2009-08-18 16:51 ` [tip:x86/urgent] i386: Fix " tip-bot for Jan Beulich
2009-08-18 17:57 ` [PATCH] i386: fix " Robert Richter
2009-08-19  6:28   ` [PATCH] i386: fix section mismatches for init code with!HOTPLUG_CPU Jan Beulich

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