Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
[pandora-kernel.git] / arch / x86 / kernel / vmlinux.lds.S
index d0bb522..bf47007 100644 (file)
@@ -69,7 +69,7 @@ jiffies_64 = jiffies;
 
 PHDRS {
        text PT_LOAD FLAGS(5);          /* R_E */
-       data PT_LOAD FLAGS(7);          /* RWE */
+       data PT_LOAD FLAGS(6);          /* RW_ */
 #ifdef CONFIG_X86_64
        user PT_LOAD FLAGS(5);          /* R_E */
 #ifdef CONFIG_SMP
@@ -116,6 +116,10 @@ SECTIONS
 
        EXCEPTION_TABLE(16) :text = 0x9090
 
+#if defined(CONFIG_DEBUG_RODATA)
+       /* .text should occupy whole number of pages */
+       . = ALIGN(PAGE_SIZE);
+#endif
        X64_ALIGN_DEBUG_RODATA_BEGIN
        RO_DATA(PAGE_SIZE)
        X64_ALIGN_DEBUG_RODATA_END
@@ -242,6 +246,12 @@ SECTIONS
                __x86_cpu_dev_end = .;
        }
 
+       /*
+        * start address and size of operations which during runtime
+        * can be patched with virtualization friendly instructions or
+        * baremetal native ones. Think page table operations.
+        * Details in paravirt_types.h
+        */
        . = ALIGN(8);
        .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
                __parainstructions = .;
@@ -249,6 +259,11 @@ SECTIONS
                __parainstructions_end = .;
        }
 
+       /*
+        * struct alt_inst entries. From the header (alternative.h):
+        * "Alternative instructions for different CPU types or capabilities"
+        * Think locking instructions on spinlocks.
+        */
        . = ALIGN(8);
        .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
                __alt_instructions = .;
@@ -256,10 +271,27 @@ SECTIONS
                __alt_instructions_end = .;
        }
 
+       /*
+        * And here are the replacement instructions. The linker sticks
+        * them as binary blobs. The .altinstructions has enough data to
+        * get the address and the length of them to patch the kernel safely.
+        */
        .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
                *(.altinstr_replacement)
        }
 
+       /*
+        * struct iommu_table_entry entries are injected in this section.
+        * It is an array of IOMMUs which during run time gets sorted depending
+        * on its dependency order. After rootfs_initcall is complete
+        * this section can be safely removed.
+        */
+       .iommu_table : AT(ADDR(.iommu_table) - LOAD_OFFSET) {
+               __iommu_table = .;
+               *(.iommu_table)
+               __iommu_table_end = .;
+       }
+       . = ALIGN(8);
        /*
         * .exit.text is discard at runtime, not link time, to deal with
         *  references from .altinstructions and .eh_frame
@@ -273,7 +305,7 @@ SECTIONS
        }
 
 #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP)
-       PERCPU(PAGE_SIZE)
+       PERCPU(THREAD_SIZE)
 #endif
 
        . = ALIGN(PAGE_SIZE);
@@ -307,7 +339,7 @@ SECTIONS
                __bss_start = .;
                *(.bss..page_aligned)
                *(.bss)
-               . = ALIGN(4);
+               . = ALIGN(PAGE_SIZE);
                __bss_stop = .;
        }