From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZB0z-0000tz-EX for qemu-devel@nongnu.org; Fri, 26 Feb 2016 00:32:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZB0w-0006t8-8Z for qemu-devel@nongnu.org; Fri, 26 Feb 2016 00:32:33 -0500 Date: Fri, 26 Feb 2016 16:02:25 +1100 From: David Gibson Message-ID: <20160226050225.GM20657@voom.fritz.box> References: <1456401731-10672-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="I4g3zIzscEHdx6fd" Content-Disposition: inline In-Reply-To: <1456401731-10672-1-git-send-email-hpoussin@reactos.org> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] dbdma: warn when using unassigned channel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Herv=E9?= Poussineau Cc: "open list:Old World" , qemu-devel@nongnu.org --I4g3zIzscEHdx6fd Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 25, 2016 at 01:02:11PM +0100, Herv=E9 Poussineau wrote: > With this, it's easier to know if a guest uses an invalid and/or unimplem= ented > DMA channel. >=20 > Signed-off-by: Herv=E9 Poussineau Merged to ppc-for-2.6, thanks. Btw, you're likely to get a prompter response if you CC me directly on patches you want merged. I only sometimes have time to go through the qemu-ppc list looking for things. > --- > hw/misc/macio/mac_dbdma.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c > index d81dea7..6051f17 100644 > --- a/hw/misc/macio/mac_dbdma.c > +++ b/hw/misc/macio/mac_dbdma.c > @@ -557,11 +557,13 @@ void DBDMA_register_channel(void *dbdma, int nchan,= qemu_irq irq, > =20 > DBDMA_DPRINTF("DBDMA_register_channel 0x%x\n", nchan); > =20 > + assert(rw); > + assert(flush); > + > ch->irq =3D irq; > ch->rw =3D rw; > ch->flush =3D flush; > ch->io.opaque =3D opaque; > - ch->io.channel =3D ch; > } > =20 > static void > @@ -775,6 +777,20 @@ static void dbdma_reset(void *opaque) > memset(s->channels[i].regs, 0, DBDMA_SIZE); > } > =20 > +static void dbdma_unassigned_rw(DBDMA_io *io) > +{ > + DBDMA_channel *ch =3D io->channel; > + qemu_log_mask(LOG_GUEST_ERROR, "%s: use of unassigned channel %d\n", > + __func__, ch->channel); > +} > + > +static void dbdma_unassigned_flush(DBDMA_io *io) > +{ > + DBDMA_channel *ch =3D io->channel; > + qemu_log_mask(LOG_GUEST_ERROR, "%s: use of unassigned channel %d\n", > + __func__, ch->channel); > +} > + > void* DBDMA_init (MemoryRegion **dbdma_mem) > { > DBDMAState *s; > @@ -784,8 +800,13 @@ void* DBDMA_init (MemoryRegion **dbdma_mem) > =20 > for (i =3D 0; i < DBDMA_CHANNELS; i++) { > DBDMA_io *io =3D &s->channels[i].io; > + DBDMA_channel *ch =3D &s->channels[i]; > qemu_iovec_init(&io->iov, 1); > - s->channels[i].channel =3D i; > + > + ch->rw =3D dbdma_unassigned_rw; > + ch->flush =3D dbdma_unassigned_flush; > + ch->channel =3D i; > + ch->io.channel =3D ch; > } > =20 > memory_region_init_io(&s->mem, NULL, &dbdma_ops, s, "dbdma", 0x1000); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --I4g3zIzscEHdx6fd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWz9xhAAoJEGw4ysog2bOSk1QQANt8nFcsxL+4jHF7IFTZqiPB b9A58esXEI4HT1pUUYjWvgQUVgiiOKwlV8QZC5LiuPyW51Ynn7aV315vHWEYixSF Bub/hLYBFpmB3rq6vFRVJiq448R9Zkic2h2oKIW+Zn6Q9dA17Xr/5nDscFQdm5xR jQFeDQHadlwcOz5QZfIoC5wvIO31HCJbDlgb9bHArAt7DSQ7EdAyC+27DWXo/HzN PpaFnUx8J9QEgdlt2Y5qLF0UyUZKhx6XuR8JhwGhmZ3aExbaGB875WLq48YDuitK qh9U3zJyIulcdN1Y2Xun+xW5IEJd9ICSYwalGJmeE7ULD9MBUX5grEpP4mq9wzMI JQR48VZys98J33ibyiANs5fpu7n17VyMwSII2GTzYiQyEnEmWCp2voRxaYT3ZsvL Gbhhz58BGyGZ/71ttPHC+xorO34k1ErpCPqgJJGjCNMinArkJiSM3Cuql3Sc2PkQ koaBrPbPiG5/BAx0ezhiVxPQAw+tNOqKWcJdtzl50db85n7cAWUwARLRFgqnDQyG XpjNpumsZk2rJ2nccjKXhCJZyOn5b761XH8n1A0N5rgDCBZOe56m7xWHRNooqGj3 TE0vQ/Ii2UqxtDvN/55MrKlh1c4FXPpIGw7c5xGvRgbzR+miLVhCmwfxEE9gwwHf Lg3Y7cqqXE7rP1hfDf5D =Sd3V -----END PGP SIGNATURE----- --I4g3zIzscEHdx6fd--