From: Philippe Coval Date: Fri, 22 Aug 2014 08:09:19 +0000 (+0200) Subject: Revert "x86/efi: Correct EFI boot stub use of code32_start" X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=462abf5fd3c2b5643b76162999639e00e61c8296;p=platform%2Fkernel%2Flinux-stable.git Revert "x86/efi: Correct EFI boot stub use of code32_start" This reverts commit 45ada9fae6d836aa8e3be5302d7aeb50c44e0629. With this change in , nexcom's vtc1010 does not boot anynore even rebased on latest version v3.14.17 and with latest firmware : ftp://ftp.nexcom.com/pub/BIOS/VTC1010/x86_32bit/MV11A109.rom ( md5=f5ccb5284ca5bd8668fa1031067dad27 ) The bug is now tracked upstream. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=82891 Change-Id: I82bb1227dcbcbfe1371d685d241e985a6e58ddf3 Bug-Tizen: TC-1513/part --- diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 78cbb2db5a85..a7677babf946 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -425,9 +425,6 @@ void setup_graphics(struct boot_params *boot_params) * Because the x86 boot code expects to be passed a boot_params we * need to create one ourselves (usually the bootloader would create * one for us). - * - * The caller is responsible for filling out ->code32_start in the - * returned boot_params. */ struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table) { @@ -486,6 +483,8 @@ struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table) hdr->vid_mode = 0xffff; hdr->boot_flag = 0xAA55; + hdr->code32_start = (__u64)(unsigned long)image->image_base; + hdr->type_of_loader = 0x21; /* Convert unicode cmdline to ascii */ diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index f45ab7a36fb6..9116aac232c7 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S @@ -50,13 +50,6 @@ ENTRY(efi_pe_entry) pushl %eax pushl %esi pushl %ecx - - call reloc -reloc: - popl %ecx - subl reloc, %ecx - movl %ecx, BP_code32_start(%eax) - sub $0x4, %esp ENTRY(efi_stub_entry) @@ -70,7 +63,12 @@ ENTRY(efi_stub_entry) hlt jmp 1b 2: - movl BP_code32_start(%esi), %eax + call 3f +3: + popl %eax + subl $3b, %eax + subl BP_pref_address(%esi), %eax + add BP_code32_start(%esi), %eax leal preferred_addr(%eax), %eax jmp *%eax diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index b10fa66a2540..c5c1ae0997e7 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -217,8 +217,6 @@ ENTRY(efi_pe_entry) cmpq $0,%rax je 1f mov %rax, %rdx - leaq startup_32(%rip), %rax - movl %eax, BP_code32_start(%rdx) popq %rsi popq %rdi @@ -232,7 +230,12 @@ ENTRY(efi_stub_entry) hlt jmp 1b 2: - movl BP_code32_start(%esi), %eax + call 3f +3: + popq %rax + subq $3b, %rax + subq BP_pref_address(%rsi), %rax + add BP_code32_start(%esi), %eax leaq preferred_addr(%rax), %rax jmp *%rax