]> git.proxmox.com Git - qemu.git/commitdiff
linuxboot: fix gdt address calculation
authorAvi Kivity <avi@redhat.com>
Thu, 24 Dec 2009 13:38:50 +0000 (15:38 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 8 Jan 2010 15:58:41 +0000 (09:58 -0600)
The gdt address calculation in linuxboot.bin is broken in two ways: first
it loads %cs into %eax, but that instruction leaves the high bits of %eax
undefined and we did not clear them.  Secondly, we completely ignore the
incorrect %eax, and use the undefined %ebx instead.

With these issues fixed, linuxboot works again.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc-bios/optionrom/linuxboot.S

index c4c9109b67b3b88e892683095f88add6956818cd..8aebe51ee592cdaaaada57bb64864b153d1c4c50 100644 (file)
@@ -86,9 +86,10 @@ copy_kernel:
        /* Now create the GDT descriptor */
        movw            $((3 * 8) - 1), -16(%bp)
        mov             %cs, %eax
+       movzwl          %ax, %eax
        shl             $4, %eax
-       addl            $gdt, %ebx
-       movl            %ebx, -14(%bp)
+       addl            $gdt, %eax
+       movl            %eax, -14(%bp)
 
        /* And load the GDT */
        data32 lgdt     -16(%bp)