[SeaBIOS] [PATCH 00/11] Relocate init code to high memory

Kevin O'Connor kevin at koconnor.net
Tue Sep 21 03:02:45 CEST 2010


On Mon, Sep 20, 2010 at 11:47:49AM +0200, Avi Kivity wrote:
>  On 09/19/2010 11:54 PM, Kevin O'Connor wrote:
> >Are you okay with me applying this patch series to seabios?  It will
> >cause kvm guest reboots to turn into shutdowns until kvm can be
> >changed.
> >
> 
> Well, we can change development versions of kvm, but not deployed
> ones.  If we apply this then we break many kvm installations.
> 
> However, if the problem is in qemu-kvm (not unlikely) then we can
> update qemu simultaneously with seabios.  Since seabios is deployed
> together with qemu, that shouldn't break installations.
> 
> Can you post a git tree for me to test?  I'd like to understand the
> issue better.

Here's a simple test case - grab the latest from
git://git.linuxtogo.org/home/kevin/seabios.git and apply the patch
below.  Then run:

kvm-qemu -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios

At the top of the output, you'll see:

1: myvar at 0x000f60bc=0 myvardelta at 0xffff60bc=0
2: myvar at 0x000f60bc=99 myvardelta at 0xffff60bc=99
3: myvar at 0x000f60bc=13 myvardelta at 0xffff60bc=13

Basically, writes to 0xf0000 are also being seen at 0xffff0000 which
is incorrect.  Gleb's patch to qemu-kvm fixes the problem.

-Kevin


diff --git a/src/post.c b/src/post.c
index 5d0e2cb..e4b5f0b 100644
--- a/src/post.c
+++ b/src/post.c
@@ -89,6 +89,21 @@ init_bda(void)
 static void
 ram_probe(void)
 {
+    {
+        static u32 myvar;
+        u32 *myvardelta = (void*)&myvar + 0xfff00000;
+        dprintf(1, "1: myvar@%p=%d myvardelta@%p=%d\n"
+                , &myvar, myvar, myvardelta, *myvardelta);
+        barrier();
+        myvar = 99;
+        dprintf(1, "2: myvar@%p=%d myvardelta@%p=%d\n"
+                , &myvar, myvar, myvardelta, *myvardelta);
+        barrier();
+        myvar = 13;
+        dprintf(1, "3: myvar@%p=%d myvardelta@%p=%d\n"
+                , &myvar, myvar, myvardelta, *myvardelta);
+    }
+
     dprintf(3, "Find memory size\n");
     if (CONFIG_COREBOOT) {
         coreboot_setup();



More information about the SeaBIOS mailing list