i386: Fix section mismatch

2007-10-17 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25d1b5167780c7f245d9655d302f6a3d8bf61d19
Commit: 25d1b5167780c7f245d9655d302f6a3d8bf61d19
Parent: 58d5fa7a6a6fc4754d295d0999b284edd67c8620
Author: Satyam Sharma [EMAIL PROTECTED]
AuthorDate: Wed Oct 17 18:04:33 2007 +0200
Committer:  Thomas Gleixner [EMAIL PROTECTED]
CommitDate: Wed Oct 17 20:15:25 2007 +0200

i386: Fix section mismatch

Fix bugzilla #8679

WARNING: arch/i386/kernel/built-in.o(.data+0x2148): Section mismatch: 
reference
to .init.text: (between 'thermal_throttle_cpu_notifier' and 'mtrr_mutex')

comes because struct notifier_block thermal_throttle_cpu_notifier in
arch/i386/kernel/cpu/mcheck/therm_throt.c goes in .data section but the
notifier callback function itself has been marked __cpuinit which becomes
__init == .init.text when HOTPLUG_CPU=n.  The warning is bogus because the
callback will never be called out if HOTPLUG_CPU=n in the first place (as
one can see from kernel/cpu.c, the cpu_chain itself is __cpuinitdata :-)

So, let's mark thermal_throttle_cpu_notifier as __cpuinitdata to fix
the section mismatch warning.

[ tglx: arch/x86 adaptation ]

Signed-off-by: Satyam Sharma [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/kernel/cpu/mcheck/therm_throt.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c 
b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 1203dc5..494d320 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -152,7 +152,7 @@ static __cpuinit int thermal_throttle_cpu_callback(struct 
notifier_block *nfb,
return NOTIFY_OK;
 }
 
-static struct notifier_block thermal_throttle_cpu_notifier =
+static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata =
 {
.notifier_call = thermal_throttle_cpu_callback,
 };
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: fix section mismatch warning in intel.c

2007-10-17 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d72b1b4f41b5159d2d0e54e54c794d500197572e
Commit: d72b1b4f41b5159d2d0e54e54c794d500197572e
Parent: 25d1b5167780c7f245d9655d302f6a3d8bf61d19
Author: Sam Ravnborg [EMAIL PROTECTED]
AuthorDate: Wed Oct 17 18:04:33 2007 +0200
Committer:  Thomas Gleixner [EMAIL PROTECTED]
CommitDate: Wed Oct 17 20:15:26 2007 +0200

i386: fix section mismatch warning in intel.c

Fix following section mismatch warning:
WARNING: vmlinux.o(.text+0xc88c): Section mismatch: reference to 
.init.text:trap_init_f00f_bug (between 'init_intel' and 'cpuid4_cache_lookup')

init_intel are __cpuint where trap_init_f00f_bug is __init.
Fixed by declaring trap_init_f00f_bug __cpuinit.

Moved the defintion of trap_init_f00f_bug to the sole user in init.c
so the ugly prototype in intel.c could get killed.

Frank van Maarseveen [EMAIL PROTECTED] supplied the .config used
to reproduce the warning.

[ tglx: arch/x86 adaptation ]

Cc: Frank van Maarseveen [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 arch/x86/kernel/cpu/intel.c |   17 +++--
 arch/x86/kernel/traps_32.c  |   14 --
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index dc4e081..cc8c501 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -8,6 +8,7 @@
 #include linux/module.h
 
 #include asm/processor.h
+#include asm/pgtable.h
 #include asm/msr.h
 #include asm/uaccess.h
 
@@ -19,8 +20,6 @@
 #include mach_apic.h
 #endif
 
-extern int trap_init_f00f_bug(void);
-
 #ifdef CONFIG_X86_INTEL_USERCOPY
 /*
  * Alignment at which movsl is preferred for bulk memory copies.
@@ -95,6 +94,20 @@ static int __cpuinit num_cpu_cores(struct cpuinfo_x86 *c)
return 1;
 }
 
+#ifdef CONFIG_X86_F00F_BUG
+static void __cpuinit trap_init_f00f_bug(void)
+{
+   __set_fixmap(FIX_F00F_IDT, __pa(idt_table), PAGE_KERNEL_RO);
+
+   /*
+* Update the IDT descriptor and reload the IDT so that
+* it uses the read-only mapped virtual address.
+*/
+   idt_descr.address = fix_to_virt(FIX_F00F_IDT);
+   load_idt(idt_descr);
+}
+#endif
+
 static void __cpuinit init_intel(struct cpuinfo_x86 *c)
 {
unsigned int l2 = 0;
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 05c27ec..0fce342 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -1112,20 +1112,6 @@ asmlinkage void math_emulate(long arg)
 
 #endif /* CONFIG_MATH_EMULATION */
 
-#ifdef CONFIG_X86_F00F_BUG
-void __init trap_init_f00f_bug(void)
-{
-   __set_fixmap(FIX_F00F_IDT, __pa(idt_table), PAGE_KERNEL_RO);
-
-   /*
-* Update the IDT descriptor and reload the IDT so that
-* it uses the read-only mapped virtual address.
-*/
-   idt_descr.address = fix_to_virt(FIX_F00F_IDT);
-   load_idt(idt_descr);
-}
-#endif
-
 /*
  * This needs to use 'idt_table' rather than 'idt', and
  * thus use the _nonmapped_ version of the IDT, as the
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: fix section mismatch warnings in mtrr

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ef231a436fddb34d806f599c97b479691b3c38b
Commit: 9ef231a436fddb34d806f599c97b479691b3c38b
Parent: 8b93789808756bcc1e5c90c99f1b1ef52f839a51
Author: Sam Ravnborg [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:10:39 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:10 2007 -0700

i386: fix section mismatch warnings in mtrr

Following section mismatch warnings were reported by Andrey Borzenkov:

WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text:amd_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x967a) 
and 'mtrr_attrib_to_str'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text:cyrix_init_mtrr from .text between 'mtrr_bp_init' (at offset 0x967f) 
and 'mtrr_attrib_to_str'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text:centaur_init_mtrr from .text between 'mtrr_bp_init' (at offset 
0x9684) and 'mtrr_attrib_to_str'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text: from .text between 'get_mtrr_state' (at offset 0xa735) and 
'generic_get_mtrr'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text: from .text between 'get_mtrr_state' (at offset 0xa749) and 
'generic_get_mtrr'
WARNING: arch/i386/kernel/built-in.o - Section mismatch: reference to 
.init.text: from .text between 'get_mtrr_state' (at offset 0xa770) and 
'generic_get_mtrr'

It was tracked down to a few functions missing __init tag.
Compile tested only.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/mtrr/generic.c |2 +-
 arch/i386/kernel/cpu/mtrr/main.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/cpu/mtrr/generic.c 
b/arch/i386/kernel/cpu/mtrr/generic.c
index f6e4694..56f64e3 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -79,7 +79,7 @@ static void print_fixed(unsigned base, unsigned step, const 
mtrr_type*types)
 }
 
 /*  Grab all of the MTRR state for this CPU into *state  */
-void get_mtrr_state(void)
+void __init get_mtrr_state(void)
 {
unsigned int i;
struct mtrr_var_range *vrs;
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 75dc6d5..c48b6fe 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -643,7 +643,7 @@ static struct sysdev_driver mtrr_sysdev_driver = {
  * initialized (i.e. before smp_init()).
  * 
  */
-__init void mtrr_bp_init(void)
+void __init mtrr_bp_init(void)
 {
init_ifs();
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: fix section mismatch warning in intel_cacheinfo

2007-07-21 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=114ab8e99c52828b37c994f580e39ce341c17d3b
Commit: 114ab8e99c52828b37c994f580e39ce341c17d3b
Parent: 2378569dd18b3b99e3535ad06b47db7c11dde7d1
Author: Sam Ravnborg [EMAIL PROTECTED]
AuthorDate: Sat Jul 21 17:11:08 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Jul 21 18:37:12 2007 -0700

i386: fix section mismatch warning in intel_cacheinfo

Fix following warning:
WARNING: arch/i386/kernel/built-in.o(.init.text+0x3818): Section mismatch: 
reference to .exit.text:cache_remove_dev (between 'cacheinfo_cpu_callback' and 
'cache_sysfs_init')

It points out that a function marked __cpuexit is calling a function marked
__cpuinit = oops.

The call happens only in an error-condition which may explain why we have
not seen it before.

The offending function was not used anywhere else - so marked it __cpuexit.

Note: This warning triggers only with a local copy of modpost
  but that version will soon be pushed out.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/cpu/intel_cacheinfo.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c 
b/arch/i386/kernel/cpu/intel_cacheinfo.c
index 43db806..d5a456d 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -743,7 +743,7 @@ static int __cpuinit cache_add_dev(struct sys_device * 
sys_dev)
return retval;
 }
 
-static void __cpuexit cache_remove_dev(struct sys_device * sys_dev)
+static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
 {
unsigned int cpu = sys_dev-id;
unsigned long i;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html