From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkLCM-0000Ss-Nu for qemu-devel@nongnu.org; Sat, 23 Nov 2013 16:57:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkLCE-0006yx-1v for qemu-devel@nongnu.org; Sat, 23 Nov 2013 16:57:06 -0500 Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]:42447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkLCD-0006yZ-Pw for qemu-devel@nongnu.org; Sat, 23 Nov 2013 16:56:57 -0500 Received: by mail-lb0-f173.google.com with SMTP id u14so2065009lbd.4 for ; Sat, 23 Nov 2013 13:56:55 -0800 (PST) Date: Sat, 23 Nov 2013 22:56:33 +0100 From: "Edgar E. Iglesias" Message-ID: <20131123215633.GL32202@zapo.xilinx.com> References: <1385133359-13770-1-git-send-email-edgar.iglesias@gmail.com> <1385133359-13770-7-git-send-email-edgar.iglesias@gmail.com> <5290ED53.5020908@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5290ED53.5020908@suse.de> Subject: Re: [Qemu-devel] [RFC PATCH 6/8] cpu: Add per-cpu address space List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Peter Maydell , qemu-devel On Sat, Nov 23, 2013 at 07:00:51PM +0100, Andreas Färber wrote: > Am 22.11.2013 17:02, schrieb Edgar E. Iglesias: > > Hi, no I actually had it in cpustate first but had to do env-get-cpu all > > over so i moved it to env. Iiuc env-get-cpu involves a dyn typecheck. > > No, it doesn't any more, it's just a pointer offset. > Hi Andreas, Looking at todays master, for example for i386: target-i386/cpu-qom.h: #define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e)) include/qom/cpu.h: #define CPU(obj) OBJECT_CHECK(CPUState, (obj), TYPE_CPU) include/qom/object.h: #define OBJECT_CHECK(type, obj, name) \ ((type *)object_dynamic_cast_assert(OBJECT(obj), (name), \ __FILE__, __LINE__, __func__)) Maybe we should remove the CPU() around xx_env_get_cpu(e)? I'm happy to move the cpu address space into CPUState, but right now I'm afraid ENV_GET_CPU will slow down some of these hot paths. Cheers, Edgar