Commit 06cc6b96 authored by Linus Torvalds's avatar Linus Torvalds

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)
parents 5645688f 6248f456
...@@ -65,7 +65,7 @@ clean-files += cpustr.h ...@@ -65,7 +65,7 @@ clean-files += cpustr.h
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
KBUILD_CFLAGS := $(USERINCLUDE) $(REALMODE_CFLAGS) -D_SETUP KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n GCOV_PROFILE := n
UBSAN_SANITIZE := n UBSAN_SANITIZE := n
......
...@@ -119,8 +119,7 @@ ENTRY(startup_32) ...@@ -119,8 +119,7 @@ ENTRY(startup_32)
*/ */
/* Load new GDT with the 64bit segments using 32bit descriptor */ /* Load new GDT with the 64bit segments using 32bit descriptor */
leal gdt(%ebp), %eax addl %ebp, gdt+2(%ebp)
movl %eax, gdt+2(%ebp)
lgdt gdt(%ebp) lgdt gdt(%ebp)
/* Enable PAE mode */ /* Enable PAE mode */
......
...@@ -142,6 +142,9 @@ startup_64: ...@@ -142,6 +142,9 @@ startup_64:
decl %ecx decl %ecx
jnz 1b jnz 1b
test %rbp, %rbp
jz .Lskip_fixup
/* /*
* Fixup the kernel text+data virtual addresses. Note that * Fixup the kernel text+data virtual addresses. Note that
* we might write invalid pmds, when the kernel is relocated * we might write invalid pmds, when the kernel is relocated
...@@ -149,9 +152,9 @@ startup_64: ...@@ -149,9 +152,9 @@ startup_64:
* beyond _end. * beyond _end.
*/ */
leaq level2_kernel_pgt(%rip), %rdi leaq level2_kernel_pgt(%rip), %rdi
leaq 4096(%rdi), %r8 leaq PAGE_SIZE(%rdi), %r8
/* See if it is a valid page table entry */ /* See if it is a valid page table entry */
1: testb $1, 0(%rdi) 1: testb $_PAGE_PRESENT, 0(%rdi)
jz 2f jz 2f
addq %rbp, 0(%rdi) addq %rbp, 0(%rdi)
/* Go to the next page */ /* Go to the next page */
...@@ -162,6 +165,7 @@ startup_64: ...@@ -162,6 +165,7 @@ startup_64:
/* Fixup phys_base */ /* Fixup phys_base */
addq %rbp, phys_base(%rip) addq %rbp, phys_base(%rip)
.Lskip_fixup:
movq $(early_level4_pgt - __START_KERNEL_map), %rax movq $(early_level4_pgt - __START_KERNEL_map), %rax
jmp 1f jmp 1f
ENTRY(secondary_startup_64) ENTRY(secondary_startup_64)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment