Received: from eggs.gnu.org ([208.118.235.92]:34973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCpX-0007qH-1H for qemu-devel@nongnu.org; Mon, 10 Dec 2012 18:32:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiCpQ-0001FV-PA for qemu-devel@nongnu.org; Mon, 10 Dec 2012 18:32:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCpQ-0001FL-GE for qemu-devel@nongnu.org; Mon, 10 Dec 2012 18:32:04 -0500 Date: Mon, 10 Dec 2012 21:33:35 -0200 From: Eduardo Habkost Message-ID: <20121210233335.GT4255@otherpad.lan.raisama.net> References: <1354645978-17362-1-git-send-email-ehabkost@redhat.com> <1355082353-322-1-git-send-email-afaerber@suse.de> <1355082353-322-2-git-send-email-afaerber@suse.de> <20121210124613.GI4255@otherpad.lan.raisama.net> <20121210195542.3e1e1d9f@thinkpad.mammed.net> <50C66E66.4030606@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50C66E66.4030606@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu 1/4] target-i386: Inline -cpu host check into cpu_x86_register() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: blauwirbel@gmail.com, Igor Mammedov , qemu-devel@nongnu.org On Tue, Dec 11, 2012 at 12:21:10AM +0100, Andreas F=E4rber wrote: > Am 10.12.2012 19:55, schrieb Igor Mammedov: > > On Mon, 10 Dec 2012 10:46:13 -0200 > > Eduardo Habkost wrote: > >=20 > >> On Sun, Dec 09, 2012 at 08:45:50PM +0100, Andreas F=E4rber wrote: > >>> Simplifies the upcoming cleanup of cpu_x86_find_by_name(). > >> > >> ...by making cpu_x86_register() more complicated, and having CPU mod= el > >> name lookup spread into different parts of the code. > >> > >> The CPU model lookup is a bit complex because of the "host" exceptio= n, > >> but at least the complexity was hidden inside cpu_x86_find_by_name() > >> (making it very easy to replace that logic by a CPU subclass lookup, > >> later). >=20 > (Somehow I didn't get this message ... yet) >=20 > > +1 >=20 > Could you guys re-review this in light of the subclasses patch? The > issue I was facing is that I did not see a reliable way to register the > host class depending on kvm_enabled(). Therefore ..._find_by_name() > becomes the class lookup whereas the host check remains a special check > in cpu_x86_init() [a faulty one I now see, ignoring "host-x86_64-cpu"]. > cpu_x86_register() is problematic in that it gets the X86CPU served on = a > silver plate, so it's too late to choose subclasses in that function. I have a patch[1] to change that in my APIC-ID-topology work in progress branch[2]. I can submit this (and maybe a few other code movements) as PATCH tomorrow. I have a branch for CPU subclasses using an approach similar to the one you used, but that includes "host" as well[3]. But I was waiting until the properties series is resubmitted, so I could use it as base and make the subclass code simpler. I will take a deeper look at your RFC tomorrow, and probably send additional comments. [1] https://github.com/ehabkost/qemu-hacks/commit/850c5531c84839919d650b2= dac6e98fa4c2529c4 [2] https://github.com/ehabkost/qemu-hacks/commits/work/apicid [3] https://github.com/ehabkost/qemu-hacks/commits/work/cpu-model-classes --=20 Eduardo