From patchwork Tue Apr 27 18:30:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 51100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 357D0B7DFA for ; Wed, 28 Apr 2010 04:35:59 +1000 (EST) Received: from localhost ([127.0.0.1]:34201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6pdU-0002Di-Bn for incoming@patchwork.ozlabs.org; Tue, 27 Apr 2010 14:35:56 -0400 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 Received: from anchor.twiddle.home (anchor.twiddle.home [172.31.0.4]) by are.twiddle.net (Postfix) with ESMTPSA id E4308484; Tue, 27 Apr 2010 11:30:53 -0700 (PDT) Message-ID: <4BD72D5D.8000306@twiddle.net> Date: Tue, 27 Apr 2010 11:30:53 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4 MIME-Version: 1.0 To: Artyom Tarasenko Subject: Re: [Qemu-devel] Re: [PATCH] Remove IO_MEM_SUBWIDTH. References: <4BD0A994.2090608@twiddle.net> <20100422234934.D3ACB101C@are.twiddle.net> In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Blue Swirl , qemu-devel@nongnu.org X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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~ Acked-by: Artyom Tarasenko 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);