qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sparc dma length bug(and fix) seen with NetBSD
@ 2008-07-01 17:23 Cliff Wright
  2008-07-01 18:00 ` Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Cliff Wright @ 2008-07-01 17:23 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Using QEMU 0.9.1 for sparc emulation, a dma length bug is seen with NetBSD.
When an 8192 byte block is read to memory using dma into non-contiguous
memory, the 2nd 4k block of contiguous memory is also written to.
This is due to an incorrect variable being used for length.
See the attached patch. I see the same bug on subversion trunk.

-- 
Cliff Wright <cliff@snipe444.org>

[-- Attachment #2: patch2.txt --]
[-- Type: text/plain, Size: 551 bytes --]

--- qemu-0.9.1/hw/iommu.c.orig	2008-01-06 11:38:42.000000000 -0800
+++ qemu-0.9.1/hw/iommu.c	2008-07-01 10:10:42.000000000 -0700
@@ -293,9 +293,9 @@
                 iommu_bad_addr(opaque, page, is_write);
                 return;
             }
-            cpu_physical_memory_write(phys_addr, buf, len);
+            cpu_physical_memory_write(phys_addr, buf, l);
         } else {
-            cpu_physical_memory_read(phys_addr, buf, len);
+            cpu_physical_memory_read(phys_addr, buf, l);
         }
         len -= l;
         buf += l;

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

* Re: [Qemu-devel] sparc dma length bug(and fix) seen with NetBSD
  2008-07-01 17:23 [Qemu-devel] sparc dma length bug(and fix) seen with NetBSD Cliff Wright
@ 2008-07-01 18:00 ` Blue Swirl
  0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2008-07-01 18:00 UTC (permalink / raw)
  To: qemu-devel

On 7/1/08, Cliff Wright <cliff@snipe444.org> wrote:
> Using QEMU 0.9.1 for sparc emulation, a dma length bug is seen with NetBSD.
>  When an 8192 byte block is read to memory using dma into non-contiguous
>  memory, the 2nd 4k block of contiguous memory is also written to.
>  This is due to an incorrect variable being used for length.
>  See the attached patch. I see the same bug on subversion trunk.

Excellent, with the patch in place I was able to install NetBSD 4.0 to
hard disk and boot to the installed system! The only wart was that
installer could not reboot the system, but that's probably a bug in
OpenBIOS (need to make reboot HW MMIO mapping more robust).

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

end of thread, other threads:[~2008-07-01 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 17:23 [Qemu-devel] sparc dma length bug(and fix) seen with NetBSD Cliff Wright
2008-07-01 18:00 ` Blue Swirl

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