x86, reboot: Fix relocations in reboot_32.S

The use of base for %ebx in this file is arbitrary, *except* that we
also use it to compute the real-mode segment. Therefore, make it so
that r_base really is the true address to which %ebx points.

This resolves kernel bugzilla 33302.

Reported-and-tested-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/n/tip-08os5wi3yq1no0y4i5m4z7he@git.kernel.org

+6 -6
+6 -6
arch/x86/kernel/reboot_32.S
··· 21 /* Get our own relocated address */ 22 call 1f 23 1: popl %ebx 24 - subl $1b, %ebx 25 26 /* Compute the equivalent real-mode segment */ 27 movl %ebx, %ecx 28 shrl $4, %ecx 29 30 /* Patch post-real-mode segment jump */ 31 - movw dispatch_table(%ebx,%eax,2),%ax 32 - movw %ax, 101f(%ebx) 33 - movw %cx, 102f(%ebx) 34 35 /* Set up the IDT for real mode. */ 36 - lidtl machine_real_restart_idt(%ebx) 37 38 /* 39 * Set up a GDT from which we can load segment descriptors for real 40 * mode. The GDT is not used in real mode; it is just needed here to 41 * prepare the descriptors. 42 */ 43 - lgdtl machine_real_restart_gdt(%ebx) 44 45 /* 46 * Load the data segment registers with 16-bit compatible values
··· 21 /* Get our own relocated address */ 22 call 1f 23 1: popl %ebx 24 + subl $(1b - r_base), %ebx 25 26 /* Compute the equivalent real-mode segment */ 27 movl %ebx, %ecx 28 shrl $4, %ecx 29 30 /* Patch post-real-mode segment jump */ 31 + movw (dispatch_table - r_base)(%ebx,%eax,2),%ax 32 + movw %ax, (101f - r_base)(%ebx) 33 + movw %cx, (102f - r_base)(%ebx) 34 35 /* Set up the IDT for real mode. */ 36 + lidtl (machine_real_restart_idt - r_base)(%ebx) 37 38 /* 39 * Set up a GDT from which we can load segment descriptors for real 40 * mode. The GDT is not used in real mode; it is just needed here to 41 * prepare the descriptors. 42 */ 43 + lgdtl (machine_real_restart_gdt - r_base)(%ebx) 44 45 /* 46 * Load the data segment registers with 16-bit compatible values