qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: fdc: refactor device creation causes guest kernel panic


From: Blue Swirl
Subject: [Qemu-devel] Re: fdc: refactor device creation causes guest kernel panic
Date: Sat, 12 Mar 2011 12:53:10 +0200

On Wed, Mar 9, 2011 at 4:34 PM, Stefan Hajnoczi <address@hidden> wrote:
> The following kernel panic occurs when the RHEL6 installer starts on
> qemu.git/master:
>
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: [<ffffffffa0062ceb>] floppy_ready+0xfb/0x730 [floppy]
>
> For full details see http://pastebin.com/SYE5A6LA.
>
> git-bisect revealed that the following commit causes this panic:
>
> commit 63ffb564dca94f8bda01ed6d209784104630a4d2
> Author: Blue Swirl <address@hidden>
> Date:   Sat Feb 5 16:32:23 2011 +0000
>
>    fdc: refactor device creation
>
>    Turn fdc_init_isa into an inline function.
>
>    Get floppy geometry directly from the drives.
>
>    Don't expose FDCtrl.
>
>    Signed-off-by: Blue Swirl <address@hidden>
>
> The CMOS value at 0x10 has changed from 0x00 to 0x40 but I have not
> located the root cause of the problem.
>
> Blue Swirl: Any thoughts on this bug?

The logic for calculating the drive state in pc.c does not match fdc.c
logic. Please try this patch.

diff --git a/hw/pc.c b/hw/pc.c
index 5966bf1..4d67d9f 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -382,7 +382,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t
above_4g_mem_size,
     /* floppy type */
     for (i = 0; i < 2; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
-        if (fd[i]) {
+        if (fd[i] && bdrv_is_inserted(fd[i]->bdrv)) {
             bdrv_get_floppy_geometry_hint(fd[i]->bdrv, &nb_heads, &max_track,
                                           &last_sect, FDRIVE_DRV_NONE,
                                           &fd_type[i]);

Attachment: 0001-pc-fix-wrong-CMOS-values-for-floppy-drives.patch
Description: Text Data


reply via email to

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