Recent floppy boot regression in qemu-system-i386

Bug #1089996 reported by Andreas Gustafsson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

In recent versions of qemu-system-i386, booting from an
emulated floppy no longer works.

Using bisection, I have determined that the problem appeared
with the following commit:

  commit 582299336879504353e60c7937fbc70fea93f3da
  Author: Julien Grall <email address hidden>
  Date: Wed Sep 19 12:50:09 2012 +0100

      hw/dma.c: Replace register_ioport_*

      Replace all register_ioport_*() with the new Memory API functions.
      This permits to use the new Memory stuff like listeners.

      Signed-off-by: Julien Grall <email address hidden>
      Acked-by: Avi Kivity <email address hidden>
      [AF: Rebased onto hwaddr]
      Signed-off-by: Andreas Färber <email address hidden>

One way to reproduce the problem is using the FreeDOS floppy image
listed on http://wiki.qemu.org/Testing, by running

  wget http://odin.fdos.org/odin2005/odin1440.img
  qemu-system-i386 -fda odin1440.img

This successfully boots FreeDOS in qemu version
258711c6448c44b60b0fecef1d3b09c71e23e304, but not
in version 582299336879504353e60c7937fbc70fea93f3da
or newer.

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 108996 V2] hw/dma.c: Fix converting of ioport_register* to MemoryRegion

On Wed, Dec 19, 2012 at 12:09:21PM +0000, Julien Grall wrote:
> The commit 582299336879504353e60c7937fbc70fea93f3da introduced a 1-shift for
> some offset in dma emulation.
>
> Before the previous commit, which converted ioport_register_* to MemoryRegion,
> the DMA controller registered 8 ioports with the following formula:
> base + ((8 + i) << d->shift) where 0 <= i < 8
> When an IO occured within a Memory Region, DMA callback receives an offset
> relative to the started address. Here the started address is:
> base + (8 << d->shift).
> The offset should be: (i << d->shift). After the shift is reverted, the offset
> are 0..7 not 1..8.
>
> Cc: <email address hidden>
> Reviewed-by: Andreas Färber <email address hidden>
> Reported-by: Andreas Gustafsson <email address hidden>
> Signed-off-by: Julien Grall <email address hidden>
> ---
>
> Modification between V1 and V2:
> * Modify the commit message to explain the problem.
>
> hw/dma.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)

This patch resolves "dma: unknown iport 0" warnings for my Windows 8 guest.

Tested-by: Stefan Hajnoczi <email address hidden>

Changed in qemu:
status: New → Fix Committed
Aurelien Jarno (aurel32)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.