From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6pYg-0000T6-HZ for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:30:58 -0400 Received: from [140.186.70.92] (port=58282 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6pYf-0000SY-BC for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:30:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6pYd-00060Z-WC for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:30:57 -0400 Received: from are.twiddle.net ([75.149.56.221]:35254) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6pYd-00060I-M7 for qemu-devel@nongnu.org; Tue, 27 Apr 2010 14:30:55 -0400 Message-ID: <4BD72D5D.8000306@twiddle.net> Date: Tue, 27 Apr 2010 11:30:53 -0700 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH. References: <4BD0A994.2090608@twiddle.net> <20100422234934.D3ACB101C@are.twiddle.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artyom Tarasenko Cc: Blue Swirl , qemu-devel@nongnu.org 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_index, CPUWriteMemoryFunc * const *mem_write, void *opaque) { + int i; + if (io_index <= 0) { io_index = get_free_io_mem_idx(); if (io_index == -1) @@ -3296,8 +3298,14 @@ static int cpu_register_io_memory_fixed(int io_index, return -1; } - memcpy(io_mem_read[io_index], mem_read, 3 * sizeof(CPUReadMemoryFunc*)); - memcpy(io_mem_write[io_index], mem_write, 3 * sizeof(CPUWriteMemoryFunc*)); + for (i = 0; i < 3; ++i) { + io_mem_read[io_index][i] + = (mem_read[i] ? mem_read[i] : unassigned_mem_read[i]); + } + for (i = 0; i < 3; ++i) { + io_mem_write[io_index][i] + = (mem_write[i] ? mem_write[i] : unassigned_mem_write[i]); + } io_mem_opaque[io_index] = opaque; return (io_index << IO_MEM_SHIFT);