qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH master, stable-0.12] linuxboot: fix gdt address calculation
Date: Fri, 08 Jan 2010 10:41:12 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 12/24/2009 07:38 AM, Avi Kivity wrote:
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<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori
---
  pc-bios/optionrom/linuxboot.S |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index c4c9109..8aebe51 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]