Received: from eggs.gnu.org ([208.118.235.92]:56296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tja8X-0001TH-OS for qemu-devel@nongnu.org; Fri, 14 Dec 2012 13:37:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tja8V-0007FA-Ue for qemu-devel@nongnu.org; Fri, 14 Dec 2012 13:37:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tja8V-0007Ez-MI for qemu-devel@nongnu.org; Fri, 14 Dec 2012 13:37:27 -0500 Date: Fri, 14 Dec 2012 16:32:19 -0200 From: Eduardo Habkost Message-ID: <20121214183219.GE3236@otherpad.lan.raisama.net> References: <1355350946-28010-1-git-send-email-ehabkost@redhat.com> <1355350946-28010-4-git-send-email-ehabkost@redhat.com> <50CB4258.3040709@suse.de> <20121214165235.GB3236@otherpad.lan.raisama.net> <50CB5FE9.3050703@suse.de> <20121214173622.GD17653@otherpad.lan.raisama.net> <20121214184720.10439cd4@thinkpad.mammed.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20121214184720.10439cd4@thinkpad.mammed.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/3] target-i386: replace cpuid_*features fields with a feature word array List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Andreas =?iso-8859-1?Q?F=E4rber?= , qemu-devel@nongnu.org On Fri, Dec 14, 2012 at 06:47:20PM +0100, Igor Mammedov wrote: > On Fri, 14 Dec 2012 15:36:22 -0200 > Eduardo Habkost wrote: >=20 > > On Fri, Dec 14, 2012 at 06:20:41PM +0100, Andreas F=E4rber wrote: > > > Am 14.12.2012 17:52, schrieb Eduardo Habkost: > > > > On Fri, Dec 14, 2012 at 04:14:32PM +0100, Andreas F=E4rber wrote: > > > >> Am 12.12.2012 23:22, schrieb Eduardo Habkost: > [...] > > >=20 > > > >> The clock code using first_cpu looks solvable; what about CR4 an= d MSR > > > >> helpers, how performance-sensitive are they? (if they're not yet= using > > > >> X86CPU for something else) > > > >=20 > > > > I guess any CPU-state code inside QEMU is not performance-sensiti= ve, as > > > > it woud already require switching between KVM kernelspace and QEM= U > > > > userspace. > > >=20 > > > I mean target-i386/[misc_]helper.c and thus TCG, IIUC. :) > >=20 > > Oh, right. I wonder how much performance impact it would have, if peo= ple > > are already using TCG. > >=20 > > Anyway, would this really have any impact at all? I mean: > > ENV_GET_CPU(env) is basically subtracing an constant offset from 'env= '. > > So I expect similar code to be generated, just using a different offs= et > > from 'env' to get the cpuid_features field. > ENV_GET_CPU(env) does dynamic_cast which is expensive. Oh, I didn't notice that. So the alternatives I see are: - Use ENV_GET_CPU() and risk performance problems; - Write a FAST_ENV_GET_CPU() macro for performance-sensitive code, that doesn't use dynamic_cast; - Keep the fields on CPUX86State and move them only after we change the TCG code to use the QOM CPU object. Personally, I prefer the third option. Moving fields from CPUArchState before making most code use the CPU QOM objects instead of CPUArchState sounds like a painful task. --=20 Eduardo