diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-12 17:13:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-12 17:13:30 -0500 |
commit | 06cc6b969c6375c65d0abbe4113af7949da29ab8 (patch) | |
tree | 587d5f99fcadaf162b260a388371bea04ef1fe1b | |
parent | 5645688f9d0d5a32f030f9c5429e1a58bedca23b (diff) | |
parent | 6248f4567442081994ad61c63bd9870e147983e0 (diff) |
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot updates from Ingo Molnar:
"Misc cleanups/simplifications by Borislav Petkov, Paul Bolle and Wei
Yang"
* 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/boot/64: Optimize fixmap page fixup
x86/boot: Simplify the GDTR calculation assembly code a bit
x86/boot/build: Remove always empty $(USERINCLUDE)
-rw-r--r-- | arch/x86/boot/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 3 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S | 8 |
3 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 12ea8f8384f4..0d810fb15eac 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -65,7 +65,7 @@ clean-files += cpustr.h | |||
65 | 65 | ||
66 | # --------------------------------------------------------------------------- | 66 | # --------------------------------------------------------------------------- |
67 | 67 | ||
68 | KBUILD_CFLAGS := $(USERINCLUDE) $(REALMODE_CFLAGS) -D_SETUP | 68 | KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP |
69 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | 69 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ |
70 | GCOV_PROFILE := n | 70 | GCOV_PROFILE := n |
71 | UBSAN_SANITIZE := n | 71 | UBSAN_SANITIZE := n |
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index efdfba21a5b2..4d85e600db78 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
@@ -119,8 +119,7 @@ ENTRY(startup_32) | |||
119 | */ | 119 | */ |
120 | 120 | ||
121 | /* Load new GDT with the 64bit segments using 32bit descriptor */ | 121 | /* Load new GDT with the 64bit segments using 32bit descriptor */ |
122 | leal gdt(%ebp), %eax | 122 | addl %ebp, gdt+2(%ebp) |
123 | movl %eax, gdt+2(%ebp) | ||
124 | lgdt gdt(%ebp) | 123 | lgdt gdt(%ebp) |
125 | 124 | ||
126 | /* Enable PAE mode */ | 125 | /* Enable PAE mode */ |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index a15d381e6020..90de28841242 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -142,6 +142,9 @@ startup_64: | |||
142 | decl %ecx | 142 | decl %ecx |
143 | jnz 1b | 143 | jnz 1b |
144 | 144 | ||
145 | test %rbp, %rbp | ||
146 | jz .Lskip_fixup | ||
147 | |||
145 | /* | 148 | /* |
146 | * Fixup the kernel text+data virtual addresses. Note that | 149 | * Fixup the kernel text+data virtual addresses. Note that |
147 | * we might write invalid pmds, when the kernel is relocated | 150 | * we might write invalid pmds, when the kernel is relocated |
@@ -149,9 +152,9 @@ startup_64: | |||
149 | * beyond _end. | 152 | * beyond _end. |
150 | */ | 153 | */ |
151 | leaq level2_kernel_pgt(%rip), %rdi | 154 | leaq level2_kernel_pgt(%rip), %rdi |
152 | leaq 4096(%rdi), %r8 | 155 | leaq PAGE_SIZE(%rdi), %r8 |
153 | /* See if it is a valid page table entry */ | 156 | /* See if it is a valid page table entry */ |
154 | 1: testb $1, 0(%rdi) | 157 | 1: testb $_PAGE_PRESENT, 0(%rdi) |
155 | jz 2f | 158 | jz 2f |
156 | addq %rbp, 0(%rdi) | 159 | addq %rbp, 0(%rdi) |
157 | /* Go to the next page */ | 160 | /* Go to the next page */ |
@@ -162,6 +165,7 @@ startup_64: | |||
162 | /* Fixup phys_base */ | 165 | /* Fixup phys_base */ |
163 | addq %rbp, phys_base(%rip) | 166 | addq %rbp, phys_base(%rip) |
164 | 167 | ||
168 | .Lskip_fixup: | ||
165 | movq $(early_level4_pgt - __START_KERNEL_map), %rax | 169 | movq $(early_level4_pgt - __START_KERNEL_map), %rax |
166 | jmp 1f | 170 | jmp 1f |
167 | ENTRY(secondary_startup_64) | 171 | ENTRY(secondary_startup_64) |