qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Stack corruption problem with SeaBIOS/gPXE under QEMU
@ 2009-11-12 11:20 Naphtali Sprei
  2009-11-14 19:47 ` Kevin O'Connor
  0 siblings, 1 reply; 21+ messages in thread
From: Naphtali Sprei @ 2009-11-12 11:20 UTC (permalink / raw)
  To: qemu-devel, Glauber Costa, coreboot

Hi,
I've found a problem with the usage of SeaBIOS/gPXE in Qemu.
The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc).
The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00.
The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

A simple hack/patch (attached) solves this problem, but a proper patch expected from the SeaBIOS guys.

 Enjoy,

  Naphtali

Patch against current SeaBIOS git


Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 src/arch/i386/prefix/pxeprefix.S |    2 +-
 src/arch/i386/prefix/romprefix.S |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/arch/i386/prefix/pxeprefix.S b/src/arch/i386/prefix/pxeprefix.S
index b541e4b..11dd45d 100644
--- a/src/arch/i386/prefix/pxeprefix.S
+++ b/src/arch/i386/prefix/pxeprefix.S
@@ -47,7 +47,7 @@ FILE_LICENCE ( GPL2_OR_LATER )
 	/* Set up stack just below 0x7c00 */
 	xorw	%ax, %ax
 	movw	%ax, %ss
-	movl	$0x7c00, %esp
+	movl	$0x7a00, %esp
 	/* Clear direction flag, for the sake of sanity */
 	cld
 	/* Print welcome message */
diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
index cb474e8..93f3f17 100644
--- a/src/arch/i386/prefix/romprefix.S
+++ b/src/arch/i386/prefix/romprefix.S
@@ -587,7 +587,7 @@ exec:	/* Set %ds = %cs */
 	/* Obtain a reasonably-sized temporary stack */
 	xorw	%ax, %ax
 	movw	%ax, %ss
-	movw	$0x7c00, %sp
+	movw	$0x7a00, %sp
 
 	/* Install gPXE */
 	movl	image_source, %esi
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-11-29 10:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12 11:20 [Qemu-devel] Stack corruption problem with SeaBIOS/gPXE under QEMU Naphtali Sprei
2009-11-14 19:47 ` Kevin O'Connor
2009-11-15  9:43   ` Naphtali Sprei
2009-11-16 13:36   ` Avi Kivity
2009-11-16 14:02     ` Avi Kivity
2009-11-17  2:26       ` Kevin O'Connor
2009-11-17 13:23         ` Avi Kivity
2009-11-21  0:47           ` Kevin O'Connor
2009-11-29 10:58             ` Avi Kivity
2009-11-18  9:39         ` Gleb Natapov
2009-11-18  9:49           ` Alexander Graf
2009-11-18  9:53             ` Gleb Natapov
2009-11-18 12:58             ` Kevin O'Connor
2009-11-18 13:06           ` Kevin O'Connor
2009-11-18 14:22             ` Gleb Natapov
2009-11-18 15:38               ` [gPXE] " Joshua Oreman
2009-11-19  1:07               ` Kevin O'Connor
2009-11-18 13:50           ` Avi Kivity
2009-11-18 14:19             ` Gleb Natapov
2009-11-18 14:21               ` Avi Kivity
2009-11-20 22:39   ` Kevin O'Connor

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).