From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7Cx1-0001J0-7T for qemu-devel@nongnu.org; Wed, 28 Apr 2010 15:29:39 -0400 Received: from [140.186.70.92] (port=49109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7Cwy-0001Gt-Pr for qemu-devel@nongnu.org; Wed, 28 Apr 2010 15:29:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7Cws-0005nX-0I for qemu-devel@nongnu.org; Wed, 28 Apr 2010 15:29:32 -0400 Received: from mail-ww0-f45.google.com ([74.125.82.45]:59392) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7Cwr-0005nO-Rc for qemu-devel@nongnu.org; Wed, 28 Apr 2010 15:29:29 -0400 Received: by wwi18 with SMTP id 18so184762wwi.4 for ; Wed, 28 Apr 2010 12:29:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BD72D5D.8000306@twiddle.net> References: <4BD0A994.2090608@twiddle.net> <20100422234934.D3ACB101C@are.twiddle.net> <4BD72D5D.8000306@twiddle.net> From: Artyom Tarasenko Date: Wed, 28 Apr 2010 21:29:07 +0200 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Blue Swirl , qemu-devel@nongnu.org 2010/4/27 Richard Henderson : > On 04/26/2010 02:54 PM, Artyom Tarasenko wrote: >> This patch introduces a regression. qemu crashes on lance test: > > I'm not sure how to get to this, since the sparc-test images don't > include ifconfig, and I havn't been able to find a sparc install > image that works (doesn't support sparc32 or sparc64 fails to load). > > That said, try this and see if it works. > > > r~ > > --- > diff --git a/exec.c b/exec.c > index 14d1fd7..572d3fd 100644 > --- a/exec.c > +++ b/exec.c > @@ -3286,6 +3286,8 @@ static int cpu_register_io_memory_fixed(int io_inde= x, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 CPUWriteMemoryFunc * const *mem_write, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 void *opaque) > =A0{ > + =A0 =A0int i; > + > =A0 =A0 if (io_index <=3D 0) { > =A0 =A0 =A0 =A0 io_index =3D get_free_io_mem_idx(); > =A0 =A0 =A0 =A0 if (io_index =3D=3D -1) > @@ -3296,8 +3298,14 @@ static int cpu_register_io_memory_fixed(int io_ind= ex, > =A0 =A0 =A0 =A0 =A0 =A0 return -1; > =A0 =A0 } > > - =A0 =A0memcpy(io_mem_read[io_index], mem_read, 3 * sizeof(CPUReadMemory= Func*)); > - =A0 =A0memcpy(io_mem_write[io_index], mem_write, 3 * sizeof(CPUWriteMem= oryFunc*)); > + =A0 =A0for (i =3D 0; i < 3; ++i) { > + =A0 =A0 =A0 =A0io_mem_read[io_index][i] > + =A0 =A0 =A0 =A0 =A0 =A0=3D (mem_read[i] ? mem_read[i] : unassigned_mem_= read[i]); > + =A0 =A0} > + =A0 =A0for (i =3D 0; i < 3; ++i) { > + =A0 =A0 =A0 =A0io_mem_write[io_index][i] > + =A0 =A0 =A0 =A0 =A0 =A0=3D (mem_write[i] ? mem_write[i] : unassigned_me= m_write[i]); > + =A0 =A0} > =A0 =A0 io_mem_opaque[io_index] =3D opaque; > > =A0 =A0 return (io_index << IO_MEM_SHIFT); > Looks good, thanks. Acked-by: Artyom Tarasenko --=20 Regards, Artyom Tarasenko solaris/sparc under qemu blog: http://tyom.blogspot.com/