From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: agraf@suse.de
Subject: [Qemu-devel] [PATCH] Fix thinko in linuxboot.S
Date: Wed, 25 Nov 2009 13:49:38 +0100 [thread overview]
Message-ID: <1259153378-27567-1-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <515008F0-22BE-4F07-AD39-F7FDB578E362@suse.de>
The %gs segment that was used was not matching the comments.
I just moved the GDT descriptor on the stack instead.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
pc-bios/optionrom/linuxboot.S | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index b3c90e3..14e1ae8 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -79,24 +79,20 @@ copy_kernel:
mode, so let's get into 32 bit mode, write the kernel and jump
back again. */
- /* Set DS to SS+SP - 0x10, so we can write our GDT descriptor there */
- mov %ss, %eax
- shl $4, %eax
- add %esp, %eax
- sub $0x10, %eax
- shr $4, %eax
+ /* Reserve space on the stack for our GDT descriptor. */
+ mov %esp, %ebp
+ sub $16, %esp
/* Now create the GDT descriptor */
+ movw $((3 * 8) - 1), -16(%bp)
mov %cs, %eax
shl $4, %eax
- movw $((3 * 8) - 1), %bx
- movw %bx, %gs:0
- movl $gdt, %ebx
- add %eax, %ebx
- movl %ebx, %gs:2
+ addl $gdt, %ebx
+ movl %ebx, -14(%bp)
/* And load the GDT */
- data32 lgdt %gs:0
+ data32 lgdt -16(%bp)
+ mov %ebp, %esp
/* Get us to protected mode now */
mov $1, %eax
--
1.6.5.2
next prev parent reply other threads:[~2009-11-25 12:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 20:53 [Qemu-devel] [PATCH 0/6] Fix -kernel with SeaBIOS v2 Alexander Graf
2009-11-12 20:53 ` [Qemu-devel] [PATCH 1/6] Make fw_cfg interface 32-bit aware Alexander Graf
2009-11-13 0:48 ` [Qemu-devel] " Glauber Costa
2009-11-13 6:15 ` Alexander Graf
2009-11-13 10:59 ` Juan Quintela
2009-11-14 10:13 ` Alexander Graf
2009-11-12 20:53 ` [Qemu-devel] [PATCH 2/6] Introduce rom_rom Alexander Graf
2009-11-12 20:53 ` [Qemu-devel] [PATCH 3/6] Convert multiboot to fw_cfg backed data storage Alexander Graf
2009-11-12 20:53 ` [Qemu-devel] [PATCH 4/6] Move common option rom code to header file Alexander Graf
2009-11-12 20:53 ` [Qemu-devel] [PATCH 5/6] Convert linux bootrom to external rom and fw_cfg Alexander Graf
2009-11-13 6:37 ` [Qemu-devel] " Paolo Bonzini
2009-11-25 10:38 ` Alexander Graf
2009-11-25 12:49 ` Paolo Bonzini [this message]
2009-11-25 12:53 ` [Qemu-devel] Re: [PATCH] Fix thinko in linuxboot.S Alexander Graf
2009-11-25 13:21 ` Paolo Bonzini
2009-11-12 20:53 ` [Qemu-devel] [PATCH 6/6] Add linuxboot to BLOBS Alexander Graf
2009-11-18 19:02 ` [Qemu-devel] [PATCH 0/6] Fix -kernel with SeaBIOS v2 Christoph Hellwig
2009-11-18 19:55 ` Anthony Liguori
2009-11-18 20:06 ` Christoph Hellwig
2009-11-18 22:06 ` Anthony Liguori
2009-11-20 9:12 ` Christoph Hellwig
2009-11-20 10:53 ` Alexander Graf
2009-11-20 11:31 ` Christoph Hellwig
2009-11-20 11:34 ` Alexander Graf
2009-11-20 13:53 ` Anthony Liguori
2009-11-23 20:21 ` Christoph Hellwig
2009-11-23 21:28 ` Alexander Graf
2009-11-23 21:36 ` Christoph Hellwig
2009-11-25 9:58 ` Alexander Graf
2009-11-26 11:42 ` Christoph Hellwig
2009-11-26 12:00 ` Alexander Graf
2009-11-26 12:18 ` Christoph Hellwig
2009-11-26 12:24 ` Alexander Graf
2009-11-30 18:50 ` Christoph Hellwig
2009-11-30 18:54 ` Avi Kivity
2009-12-11 16:39 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1259153378-27567-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).