diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-23 02:05:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-23 02:05:49 -0400 |
commit | f3670394c29ff3730638762c1760fd2f624e6d7b (patch) | |
tree | 1169572c9721d34b9ecd6144c812f8a760f746f4 /arch/x86/boot/compressed | |
parent | 98f75b8291a89ba6bf73e322ee467ce0bfeb91c1 (diff) |
Revert "x86/efi: Fixup GOT in all boot code paths"
This reverts commit 9cb0e394234d244fe5a97e743ec9dd7ddff7e64b.
It causes my Sony Vaio Pro 11 to immediately reboot at startup.
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/boot/compressed')
-rw-r--r-- | arch/x86/boot/compressed/head_32.S | 54 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 56 |
2 files changed, 29 insertions, 81 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index d6b8aa4c986c..cbed1407a5cd 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
@@ -30,33 +30,6 @@ | |||
30 | #include <asm/boot.h> | 30 | #include <asm/boot.h> |
31 | #include <asm/asm-offsets.h> | 31 | #include <asm/asm-offsets.h> |
32 | 32 | ||
33 | /* | ||
34 | * Adjust our own GOT | ||
35 | * | ||
36 | * The relocation base must be in %ebx | ||
37 | * | ||
38 | * It is safe to call this macro more than once, because in some of the | ||
39 | * code paths multiple invocations are inevitable, e.g. via the efi* | ||
40 | * entry points. | ||
41 | * | ||
42 | * Relocation is only performed the first time. | ||
43 | */ | ||
44 | .macro FIXUP_GOT | ||
45 | cmpb $1, got_fixed(%ebx) | ||
46 | je 2f | ||
47 | |||
48 | leal _got(%ebx), %edx | ||
49 | leal _egot(%ebx), %ecx | ||
50 | 1: | ||
51 | cmpl %ecx, %edx | ||
52 | jae 2f | ||
53 | addl %ebx, (%edx) | ||
54 | addl $4, %edx | ||
55 | jmp 1b | ||
56 | 2: | ||
57 | movb $1, got_fixed(%ebx) | ||
58 | .endm | ||
59 | |||
60 | __HEAD | 33 | __HEAD |
61 | ENTRY(startup_32) | 34 | ENTRY(startup_32) |
62 | #ifdef CONFIG_EFI_STUB | 35 | #ifdef CONFIG_EFI_STUB |
@@ -83,9 +56,6 @@ ENTRY(efi_pe_entry) | |||
83 | add %esi, 88(%eax) | 56 | add %esi, 88(%eax) |
84 | pushl %eax | 57 | pushl %eax |
85 | 58 | ||
86 | movl %esi, %ebx | ||
87 | FIXUP_GOT | ||
88 | |||
89 | call make_boot_params | 59 | call make_boot_params |
90 | cmpl $0, %eax | 60 | cmpl $0, %eax |
91 | je fail | 61 | je fail |
@@ -111,10 +81,6 @@ ENTRY(efi32_stub_entry) | |||
111 | leal efi32_config(%esi), %eax | 81 | leal efi32_config(%esi), %eax |
112 | add %esi, 88(%eax) | 82 | add %esi, 88(%eax) |
113 | pushl %eax | 83 | pushl %eax |
114 | |||
115 | movl %esi, %ebx | ||
116 | FIXUP_GOT | ||
117 | |||
118 | 2: | 84 | 2: |
119 | call efi_main | 85 | call efi_main |
120 | cmpl $0, %eax | 86 | cmpl $0, %eax |
@@ -224,7 +190,19 @@ relocated: | |||
224 | shrl $2, %ecx | 190 | shrl $2, %ecx |
225 | rep stosl | 191 | rep stosl |
226 | 192 | ||
227 | FIXUP_GOT | 193 | /* |
194 | * Adjust our own GOT | ||
195 | */ | ||
196 | leal _got(%ebx), %edx | ||
197 | leal _egot(%ebx), %ecx | ||
198 | 1: | ||
199 | cmpl %ecx, %edx | ||
200 | jae 2f | ||
201 | addl %ebx, (%edx) | ||
202 | addl $4, %edx | ||
203 | jmp 1b | ||
204 | 2: | ||
205 | |||
228 | /* | 206 | /* |
229 | * Do the decompression, and jump to the new kernel.. | 207 | * Do the decompression, and jump to the new kernel.. |
230 | */ | 208 | */ |
@@ -247,12 +225,8 @@ relocated: | |||
247 | xorl %ebx, %ebx | 225 | xorl %ebx, %ebx |
248 | jmp *%eax | 226 | jmp *%eax |
249 | 227 | ||
250 | .data | ||
251 | /* Have we relocated the GOT? */ | ||
252 | got_fixed: | ||
253 | .byte 0 | ||
254 | |||
255 | #ifdef CONFIG_EFI_STUB | 228 | #ifdef CONFIG_EFI_STUB |
229 | .data | ||
256 | efi32_config: | 230 | efi32_config: |
257 | .fill 11,8,0 | 231 | .fill 11,8,0 |
258 | .long efi_call_phys | 232 | .long efi_call_phys |
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 50f69c7eaaf4..2884e0c3e8a5 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
@@ -32,33 +32,6 @@ | |||
32 | #include <asm/processor-flags.h> | 32 | #include <asm/processor-flags.h> |
33 | #include <asm/asm-offsets.h> | 33 | #include <asm/asm-offsets.h> |
34 | 34 | ||
35 | /* | ||
36 | * Adjust our own GOT | ||
37 | * | ||
38 | * The relocation base must be in %rbx | ||
39 | * | ||
40 | * It is safe to call this macro more than once, because in some of the | ||
41 | * code paths multiple invocations are inevitable, e.g. via the efi* | ||
42 | * entry points. | ||
43 | * | ||
44 | * Relocation is only performed the first time. | ||
45 | */ | ||
46 | .macro FIXUP_GOT | ||
47 | cmpb $1, got_fixed(%rip) | ||
48 | je 2f | ||
49 | |||
50 | leaq _got(%rip), %rdx | ||
51 | leaq _egot(%rip), %rcx | ||
52 | 1: | ||
53 | cmpq %rcx, %rdx | ||
54 | jae 2f | ||
55 | addq %rbx, (%rdx) | ||
56 | addq $8, %rdx | ||
57 | jmp 1b | ||
58 | 2: | ||
59 | movb $1, got_fixed(%rip) | ||
60 | .endm | ||
61 | |||
62 | __HEAD | 35 | __HEAD |
63 | .code32 | 36 | .code32 |
64 | ENTRY(startup_32) | 37 | ENTRY(startup_32) |
@@ -279,13 +252,10 @@ ENTRY(efi_pe_entry) | |||
279 | subq $1b, %rbp | 252 | subq $1b, %rbp |
280 | 253 | ||
281 | /* | 254 | /* |
282 | * Relocate efi_config->call() and the GOT entries. | 255 | * Relocate efi_config->call(). |
283 | */ | 256 | */ |
284 | addq %rbp, efi64_config+88(%rip) | 257 | addq %rbp, efi64_config+88(%rip) |
285 | 258 | ||
286 | movq %rbp, %rbx | ||
287 | FIXUP_GOT | ||
288 | |||
289 | movq %rax, %rdi | 259 | movq %rax, %rdi |
290 | call make_boot_params | 260 | call make_boot_params |
291 | cmpq $0,%rax | 261 | cmpq $0,%rax |
@@ -301,13 +271,10 @@ handover_entry: | |||
301 | subq $1b, %rbp | 271 | subq $1b, %rbp |
302 | 272 | ||
303 | /* | 273 | /* |
304 | * Relocate efi_config->call() and the GOT entries. | 274 | * Relocate efi_config->call(). |
305 | */ | 275 | */ |
306 | movq efi_config(%rip), %rax | 276 | movq efi_config(%rip), %rax |
307 | addq %rbp, 88(%rax) | 277 | addq %rbp, 88(%rax) |
308 | |||
309 | movq %rbp, %rbx | ||
310 | FIXUP_GOT | ||
311 | 2: | 278 | 2: |
312 | movq efi_config(%rip), %rdi | 279 | movq efi_config(%rip), %rdi |
313 | call efi_main | 280 | call efi_main |
@@ -418,8 +385,19 @@ relocated: | |||
418 | shrq $3, %rcx | 385 | shrq $3, %rcx |
419 | rep stosq | 386 | rep stosq |
420 | 387 | ||
421 | FIXUP_GOT | 388 | /* |
422 | 389 | * Adjust our own GOT | |
390 | */ | ||
391 | leaq _got(%rip), %rdx | ||
392 | leaq _egot(%rip), %rcx | ||
393 | 1: | ||
394 | cmpq %rcx, %rdx | ||
395 | jae 2f | ||
396 | addq %rbx, (%rdx) | ||
397 | addq $8, %rdx | ||
398 | jmp 1b | ||
399 | 2: | ||
400 | |||
423 | /* | 401 | /* |
424 | * Do the decompression, and jump to the new kernel.. | 402 | * Do the decompression, and jump to the new kernel.. |
425 | */ | 403 | */ |
@@ -459,10 +437,6 @@ gdt: | |||
459 | .quad 0x0000000000000000 /* TS continued */ | 437 | .quad 0x0000000000000000 /* TS continued */ |
460 | gdt_end: | 438 | gdt_end: |
461 | 439 | ||
462 | /* Have we relocated the GOT? */ | ||
463 | got_fixed: | ||
464 | .byte 0 | ||
465 | |||
466 | #ifdef CONFIG_EFI_STUB | 440 | #ifdef CONFIG_EFI_STUB |
467 | efi_config: | 441 | efi_config: |
468 | .quad 0 | 442 | .quad 0 |