Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H9ItK-0005nB-Cd for qemu-devel@nongnu.org; Tue, 23 Jan 2007 05:28:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H9ItI-0005mj-HJ for qemu-devel@nongnu.org; Tue, 23 Jan 2007 05:28:37 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9ItI-0005mS-5X for qemu-devel@nongnu.org; Tue, 23 Jan 2007 05:28:36 -0500 Received: from [66.139.79.212] (helo=tapir.sajinet.com.pe) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H9ItH-00040r-QX for qemu-devel@nongnu.org; Tue, 23 Jan 2007 05:28:36 -0500 Date: Tue, 23 Jan 2007 04:40:42 -0600 From: Carlo Marcelo Arenas Belon Message-ID: <20070123104042.GB10278@tapir.sajinet.com.pe> References: <20070115092136.GA22284@tapir.sajinet.com.pe> <20070122102316.GA2618@tapir.sajinet.com.pe> <45B4980F.8080005@aurel32.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <45B4980F.8080005@aurel32.net> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: DMA timeouts running a FreeBSD guest with last CVS snapshot Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Jan 22, 2007 at 11:55:11AM +0100, Aurelien Jarno wrote: > Carlo Marcelo Arenas Belon a =E9crit : > >=20 > > The following patch moves the initialization of bm->cur_addr to match= =20 > > FreeBSD behavior while being also compatible with all other guests > >=20 the following snippet kept the initialization of bm->cur_addr inside the ide_dma_start function as a failback as that is where it conceptually bel= ongs. that is not needed though, as the initialization of bm->addr and also bm->cur_addr is now done when the address for DMA is send to the emulated PIIX. > > Index: hw/ide.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > RCS file: /sources/qemu/qemu/hw/ide.c,v > > retrieving revision 1.51 > > diff -u -r1.51 ide.c > > --- hw/ide.c 20 Jan 2007 01:12:17 -0000 1.51 > > +++ hw/ide.c 22 Jan 2007 09:50:20 -0000 > > @@ -2230,10 +2230,11 @@ > > return; > > bm->ide_if =3D s; > > bm->dma_cb =3D dma_cb; > > - bm->cur_addr =3D bm->addr; > > bm->cur_prd_last =3D 0; > > bm->cur_prd_addr =3D 0; > > bm->cur_prd_len =3D 0; > > + if (bm->cur_addr !=3D bm->addr) > > + bm->cur_addr =3D bm->addr; >=20 > Why using a condition here? This will probably be slower than doing > bm->cur_addr =3D bm->addr and the result is the same. as I mentioned before, this initialization is not even needed, but I kept it as a way to keep the original logic that used this function to se= tup all initial values for the DMA. in retrospective though I can see why it was a bad idea and confusing, so= I'd prepared version 2 of the patch that removes this and eliminates your con= cern as well. thanks, Carlo