]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
commit f8657e1b55901e6c227094258d1fa3642fa242bd git-9b5587cdd9f2a8dd4a010a93a6380051d43a3c16
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:05:21 +0000 (12:05 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:05:21 +0000 (12:05 +0000)
Author: Vivek Goyal <vgoyal@in.ibm.com>
Date:   Tue Feb 13 13:26:22 2007 +0100

    [PATCH] i386: move startup_32() in text.head section

    o Entry startup_32 was in .text section but it was accessing some init
      data too and it prompts MODPOST to generate compilation warnings.

    WARNING: vmlinux - Section mismatch: reference to .init.data:boot_params from
    .text between '_text' (at offset 0xc0100029) and 'startup_32_smp'
    WARNING: vmlinux - Section mismatch: reference to .init.data:boot_params from
    .text between '_text' (at offset 0xc0100037) and 'startup_32_smp'
    WARNING: vmlinux - Section mismatch: reference to
    .init.data:init_pg_tables_end from .text between '_text' (at offset
    0xc0100099) and 'startup_32_smp'

    o Can't move startup_32 to .init.text as this entry point has to be at the
      start of bzImage. Hence moved startup_32 to a new section .text.head and
      instructed MODPOST to not to generate warnings if init data is being
      accessed from .text.head section. This code has been audited.

    o SMP boot up code (startup_32_smp) can go into .init.text if CPU hotplug
      is not supported. Otherwise it generates more warnings

    WARNING: vmlinux - Section mismatch: reference to .init.data:new_cpu_data from
    .text between 'checkCPUtype' (at offset 0xc0100126) and 'is486'
    WARNING: vmlinux - Section mismatch: reference to .init.data:new_cpu_data from
    .text between 'checkCPUtype' (at offset 0xc0100130) and 'is486'

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
arch/i386/kernel/head.S
arch/i386/kernel/vmlinux.lds.S
scripts/mod/modpost.c

index a6b8bd89aa27192ea507a6c8fee660e414b059b9..783ca12ab919920b2f8b53b34c60a7a460f2a332 100644 (file)
@@ -53,6 +53,7 @@
  * any particular GDT layout, because we load our own as soon as we
  * can.
  */
+.section .text.head,"ax",@progbits
 ENTRY(startup_32)
 
 /*
@@ -135,16 +136,25 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
        jb 10b
        movl %edi,(init_pg_tables_end - __PAGE_OFFSET)
 
-#ifdef CONFIG_SMP
        xorl %ebx,%ebx                          /* This is the boot CPU (BSP) */
        jmp 3f
-
 /*
  * Non-boot CPU entry point; entered from trampoline.S
  * We can't lgdt here, because lgdt itself uses a data segment, but
  * we know the trampoline has already loaded the boot_gdt_table GDT
  * for us.
+ *
+ * If cpu hotplug is not supported then this code can go in init section
+ * which will be freed later
  */
+
+#ifdef CONFIG_HOTPLUG_CPU
+.section .text,"ax",@progbits
+#else
+.section .init.text,"ax",@progbits
+#endif
+
+#ifdef CONFIG_SMP
 ENTRY(startup_32_smp)
        cld
        movl $(__BOOT_DS),%eax
@@ -202,8 +212,8 @@ ENTRY(startup_32_smp)
        xorl %ebx,%ebx
        incl %ebx
 
-3:
 #endif /* CONFIG_SMP */
+3:
 
 /*
  * Enable paging
@@ -405,6 +415,7 @@ ignore_int:
 #endif
        iret
 
+.section .text
 /*
  * Real beginning of normal "text" segment
  */
index 2153fc7da3f7ecfa0a4c80ac98b0abec4026fa30..0528e5540bf05bb36cd82cbaea3a3a93871665fa 100644 (file)
@@ -23,8 +23,13 @@ SECTIONS
 {
   . = __KERNEL_START;
   phys_startup_32 = startup_32 - LOAD_OFFSET;
+
+  .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
+       _text = .;                      /* Text and read-only data */
+       *(.text.head)
+  } :text = 0x9090
+
   /* read-only */
-  _text = .;                   /* Text and read-only data */
   .text : AT(ADDR(.text) - LOAD_OFFSET) {
        *(.text)
        SCHED_TEXT
index dfde0e87a765e2e53c55f82fd505f22e76523999..a682f3107deb1dc5e79f4051613a6777d8bd1eb0 100644 (file)
@@ -901,6 +901,7 @@ static int init_section_ref_ok(const char *name)
                ".stab",
                ".rodata",
                ".text.lock",
+               ".text.head",
                "__bug_table", /* used by powerpc for BUG() */
                ".pci_fixup_header",
                ".pci_fixup_final",