From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2egn-0002EM-Of for qemu-devel@nongnu.org; Wed, 10 Jun 2015 08:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2egk-0005oX-1P for qemu-devel@nongnu.org; Wed, 10 Jun 2015 08:01:01 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:7711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2egj-0005no-QZ for qemu-devel@nongnu.org; Wed, 10 Jun 2015 08:00:57 -0400 Message-ID: <557826F0.5040005@imgtec.com> Date: Wed, 10 Jun 2015 13:00:48 +0100 From: Leon Alrae MIME-Version: 1.0 References: <1433364350-19380-1-git-send-email-hpoussin@reactos.org> <1433364350-19380-17-git-send-email-hpoussin@reactos.org> In-Reply-To: <1433364350-19380-17-git-send-email-hpoussin@reactos.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 16/16] [RFC] dma/rc4030: do multiple calls to address_space_rw when doing DMA transfers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , qemu-devel@nongnu.org Cc: Aurelien Jarno Hi Herv=C3=A9, On 03/06/2015 21:45, Herv=C3=A9 Poussineau wrote: > This fixes Windows NT 4.0/MIPS, which was always bugchecking with > IRQL_NOT_LESS_OR_EQUAL. >=20 > Signed-off-by: Herv=C3=A9 Poussineau > --- > hw/dma/rc4030.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c > index 3efa6de..deac0a8 100644 > --- a/hw/dma/rc4030.c > +++ b/hw/dma/rc4030.c > @@ -681,6 +681,7 @@ static void rc4030_do_dma(void *opaque, int n, uint= 8_t *buf, int len, int is_wri > rc4030State *s =3D opaque; > hwaddr dma_addr; > int dev_to_mem; > + int i; > =20 > s->dma_regs[n][DMA_REG_ENABLE] &=3D ~(DMA_FLAG_TC_INTR | DMA_FLAG_= MEM_INTR | DMA_FLAG_ADDR_INTR); > =20 > @@ -699,8 +700,17 @@ static void rc4030_do_dma(void *opaque, int n, uin= t8_t *buf, int len, int is_wri > dma_addr =3D s->dma_regs[n][DMA_REG_ADDRESS]; > =20 > /* Read/write data at right place */ > - address_space_rw(&s->dma_as, dma_addr, MEMTXATTRS_UNSPECIFIED, > - buf, len, is_write); > + for (i =3D 0; i < len; ) { > + int ncpy =3D DMA_PAGESIZE - (dma_addr & (DMA_PAGESIZE - 1)); > + if (ncpy > len - i) { > + ncpy =3D len - i; > + } > + address_space_rw(&s->dma_as, dma_addr, MEMTXATTRS_UNSPECIFIED, > + buf + i, ncpy, is_write); > + > + dma_addr +=3D ncpy; > + i +=3D ncpy; > + } > =20 > s->dma_regs[n][DMA_REG_ENABLE] |=3D DMA_FLAG_TC_INTR; > s->dma_regs[n][DMA_REG_COUNT] -=3D len; >=20 I'm sending out current target-mips queue soon and I can include this ser= ies, but I'm not quite sure what to do with this RFC patch. I presume you put = RFC here because it's a workaround for a bug, but it's not clear where the ac= tual bug is? Thanks, Leon