From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvkBX-0007qw-Dy for qemu-devel@nongnu.org; Mon, 09 Nov 2015 06:00:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvkBW-0002Fy-Jh for qemu-devel@nongnu.org; Mon, 09 Nov 2015 06:00:27 -0500 References: <1446747358-18214-1-git-send-email-peter.maydell@linaro.org> <1446747358-18214-9-git-send-email-peter.maydell@linaro.org> <56407A2C.7050906@redhat.com> From: Paolo Bonzini Message-ID: <56407CBA.9020705@redhat.com> Date: Mon, 9 Nov 2015 12:00:10 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/16] exec.c: Have one io_mem_watch per AddressSpace List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Patch Tracking , QEMU Developers , qemu-arm@nongnu.org, "Edgar E. Iglesias" , =?UTF-8?Q?Alex_Benn=c3=a9e?= , =?UTF-8?Q?Andreas_F=c3=a4rber?= On 09/11/2015 11:54, Peter Maydell wrote: > > current_cpu is available here, so it should be possible to have only one > > io_mem_watch per CPU address space index (i.e. two). > > So the opaque gives you the asidx and then you look at current_cpu's > cpu_ases[asidx]? Yeah, that works and is simpler. (Good argument for > making "number of ASes per CPU" a compile-time constant I guess.) Yes. Of course it works well only if the compile-time constant is small---but again, my guess is that it'll be two. It would be even better if you can use the attrs instead of the opaque to compute the asidx. Then the only change you need is to watch_mem_*. Paolo