2008-10-12 09:39:22

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 0/7] post x86 merge section mismatch fixes

[PATCH 1/7] x86, xsave: fix section mismatch warning - setup_xstate_init
[PATCH 2/7] x86: fix section mismatch warning - reserve_region_with_split
[PATCH 3/7] x86: fix section mismatch warning - apic_flat
[PATCH 4/7] x86: fix section mismatch warning - apic_physflat
[PATCH 5/7] x86: fix section mismatch warning - apic_x2apic_uv_x
[PATCH 6/7] x86: fix section mismatch warning - apic_x2apic_cluster
[PATCH 7/7] x86: fix section mismatch warning - apic_x2apic_phys

arch/x86/kernel/genapic_flat_64.c | 4 ++--
arch/x86/kernel/genx2apic_cluster.c | 2 +-
arch/x86/kernel/genx2apic_phys.c | 2 +-
arch/x86/kernel/genx2apic_uv_x.c | 2 +-
arch/x86/kernel/xsave.c | 2 +-
kernel/resource.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)

One warning left:

WARNING: vmlinux.o(.cpuinit.text+0x4ad): Section mismatch in reference from the function fpu_init() to the function .init.text:init_thread_xstate()
The function __cpuinit fpu_init() references
a function __init init_thread_xstate().
If init_thread_xstate is only used by fpu_init then
annotate init_thread_xstate with a matching annotation.

x86_64 cpu_init() (marked __cpu_init) calls fpu_init() (marked __cpu_init)
and fpu_init calls init_thread_xstate (which is __init) if smp_processor_id() == 0.
So it's probably OK, but it should be fixed properly (without ugly __ref)


Marcin


2008-10-12 09:39:40

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 1/7] x86, xsave: fix section mismatch warning - setup_xstate_init

setup_xstate_init calls __init function (alloc_bootmem) and is called only
from __init function (xsave_cntxt_init), so mark it static __init

WARNING: vmlinux.o(.text+0x8f7b): Section mismatch in reference from the function setup_xstate_init() to the function .init.text:__alloc_bootmem()
The function setup_xstate_init() references
the function __init __alloc_bootmem().
This is often because setup_xstate_init lacks a __init
annotation or the annotation of __alloc_bootmem is wrong.

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Suresh Siddha <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
arch/x86/kernel/xsave.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 07713d6..ed5274a 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -272,7 +272,7 @@ void __cpuinit xsave_init(void)
/*
* setup the xstate image representing the init state
*/
-void setup_xstate_init(void)
+static void __init setup_xstate_init(void)
{
init_xstate_buf = alloc_bootmem(xstate_size);
init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT;
--
1.5.6.4

2008-10-12 09:44:45

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 2/7] x86: fix section mismatch warning - reserve_region_with_split

reserve_region_with_split calls __init function (__reserve_region_with_split)
and is called only from __init function (e820_reserve_resources_late),
so mark it __init

WARNING: vmlinux.o(.text+0x30299): Section mismatch in reference from the function reserve_region_with_split() to the function .init.text:__reserve_region_with_split()
The function reserve_region_with_split() references
the function __init __reserve_region_with_split().
This is often because reserve_region_with_split lacks a __init
annotation or the annotation of __reserve_region_with_split is wrong.

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
kernel/resource.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 414d6fc..914cea6 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -575,7 +575,7 @@ static void __init __reserve_region_with_split(struct resource *root,

}

-void reserve_region_with_split(struct resource *root,
+void __init reserve_region_with_split(struct resource *root,
resource_size_t start, resource_size_t end,
const char *name)
{
--
1.5.6.4

2008-10-12 09:45:05

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 3/7] x86: fix section mismatch warning - apic_flat

WARNING: vmlinux.o(.data+0xbe08): Section mismatch in reference from the variable apic_flat to the function .init.text:flat_acpi_madt_oem_check()
The variable apic_flat references
the function __init flat_acpi_madt_oem_check()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
arch/x86/kernel/genapic_flat_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 9eca5ba..56d552c 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -25,7 +25,7 @@
#include <acpi/acpi_bus.h>
#endif

-static int __init flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
return 1;
}
--
1.5.6.4

2008-10-12 09:45:37

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 4/7] x86: fix section mismatch warning - apic_physflat

WARNING: vmlinux.o(.data+0xbe88): Section mismatch in reference from the variable apic_physflat to the function .init.text:physflat_acpi_madt_oem_check()
The variable apic_physflat references
the function __init physflat_acpi_madt_oem_check()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
arch/x86/kernel/genapic_flat_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 56d552c..59a732f 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -170,7 +170,7 @@ struct genapic apic_flat = {
* We cannot use logical delivery in this case because the mask
* overflows, so use physical mode.
*/
-static int __init physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
#ifdef CONFIG_ACPI
/*
--
1.5.6.4

2008-10-12 09:45:55

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 5/7] x86: fix section mismatch warning - apic_x2apic_uv_x

WARNING: vmlinux.o(.data+0xbf08): Section mismatch in reference from the variable apic_x2apic_uv_x to the function .init.text:uv_acpi_madt_oem_check()
The variable apic_x2apic_uv_x references
the function __init uv_acpi_madt_oem_check()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
arch/x86/kernel/genx2apic_uv_x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index ae2ffc8..b1369f4 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -30,7 +30,7 @@ DEFINE_PER_CPU(int, x2apic_extra_bits);

static enum uv_system_type uv_system_type;

-static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
if (!strcmp(oem_id, "SGI")) {
if (!strcmp(oem_table_id, "UVL"))
--
1.5.6.4

2008-10-12 09:46:17

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 6/7] x86: fix section mismatch warning - apic_x2apic_cluster

WARNING: vmlinux.o(.data+0xbf88): Section mismatch in reference from the variable apic_x2apic_cluster to the function .init.text:x2apic_acpi_madt_oem_check()
The variable apic_x2apic_cluster references
the function __init x2apic_acpi_madt_oem_check()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
arch/x86/kernel/genx2apic_cluster.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index e4bf2cc..f6a2c8e 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -12,7 +12,7 @@

DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid);

-static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
if (cpu_has_x2apic)
return 1;
--
1.5.6.4

2008-10-12 09:46:52

by Marcin Ślusarz

[permalink] [raw]
Subject: [PATCH 7/7] x86: fix section mismatch warning - apic_x2apic_phys

WARNING: vmlinux.o(.data+0xc008): Section mismatch in reference from the variable apic_x2apic_phys to the function .init.text:x2apic_acpi_madt_oem_check()
The variable apic_x2apic_phys references
the function __init x2apic_acpi_madt_oem_check()
If the reference is valid then annotate the
variable with __init* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Ingo Molnar <[email protected]>
---
arch/x86/kernel/genx2apic_phys.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 8f1343d..d042211 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -19,7 +19,7 @@ static int set_x2apic_phys_mode(char *arg)
}
early_param("x2apic_phys", set_x2apic_phys_mode);

-static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
if (cpu_has_x2apic && x2apic_phys)
return 1;
--
1.5.6.4

2008-10-12 09:57:47

by Rufus & Azrael

[permalink] [raw]
Subject: Re:[PATCH 0/7] post x86 merge section mismatch fixes

Hello Marcin,


I have applied your patches on my fresh 2.6.27-git2 kernel and the
section mismatches are now fixed, just remaining the following:

> WARNING: arch/x86/kernel/built-in.o(.cpuinit.text+0x347): Section
> mismatch in reference from the function fpu_init() to the function
> .init.text:init_thread_xstate()
> The function __cpuinit fpu_init() references
> a function __init init_thread_xstate().
> If init_thread_xstate is only used by fpu_init then
> annotate init_thread_xstate with a matching annotation.
>
> WARNING: kernel/built-in.o(.text+0x10690): Section mismatch in
> reference from the function notify_cpu_starting() to the variable
> .cpuinit.data:cpu_chain
> The function notify_cpu_starting() references
> the variable __cpuinitdata cpu_chain.
> This is often because notify_cpu_starting lacks a __cpuinitdata
> annotation or the annotation of cpu_chain is wrong.
>
> WARNING: vmlinux.o(.text+0x33264): Section mismatch in reference from
> the function notify_cpu_starting() to the variable .cpuinit.data:cpu_chain
> The function notify_cpu_starting() references
> the variable __cpuinitdata cpu_chain.
> This is often because notify_cpu_starting lacks a __cpuinitdata
> annotation or the annotation of cpu_chain is wrong.
>
> WARNING: vmlinux.o(.cpuinit.text+0x605): Section mismatch in reference
> from the function fpu_init() to the function
> .init.text:init_thread_xstate()
> The function __cpuinit fpu_init() references
> a function __init init_thread_xstate().
> If init_thread_xstate is only used by fpu_init then
> annotate init_thread_xstate with a matching annotation.
Thanks and regards.

2008-10-22 15:37:52

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 0/7] post x86 merge section mismatch fixes


* Marcin Slusarz <[email protected]> wrote:

> [PATCH 1/7] x86, xsave: fix section mismatch warning - setup_xstate_init
> [PATCH 2/7] x86: fix section mismatch warning - reserve_region_with_split
> [PATCH 3/7] x86: fix section mismatch warning - apic_flat
> [PATCH 4/7] x86: fix section mismatch warning - apic_physflat
> [PATCH 5/7] x86: fix section mismatch warning - apic_x2apic_uv_x
> [PATCH 6/7] x86: fix section mismatch warning - apic_x2apic_cluster
> [PATCH 7/7] x86: fix section mismatch warning - apic_x2apic_phys

applied these to tip/x86/urgent:

3cfba08: x86: fix section mismatch warning - apic_x2apic_phys
2caa371: x86: fix section mismatch warning - apic_x2apic_cluster
f8827c0: x86: fix section mismatch warning - apic_x2apic_uv_x
fae1721: x86: fix section mismatch warning - apic_physflat
983f91f: x86: fix section mismatch warning - apic_flat

the warnings are harmless but worth fixing nevertheless.

Thanks Marcin!

Ingo