Received: from eggs.gnu.org ([2001:4830:134:3::10]:46576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgAvG-00089m-J1 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 08:56:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgAvF-0002vN-Lr for qemu-devel@nongnu.org; Tue, 21 Feb 2017 08:56:06 -0500 From: Markus Armbruster References: <1487357795-52614-1-git-send-email-imammedo@redhat.com> <20170220195500.332a4844@nial.brq.redhat.com> <20170221134416.5803b3e5@nial.brq.redhat.com> Date: Tue, 21 Feb 2017 14:56:00 +0100 In-Reply-To: (Peter Maydell's message of "Tue, 21 Feb 2017 12:55:20 +0000") Message-ID: <87poibr6kv.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC 0/3] generalize parsing of cpu_model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Igor Mammedov , Eduardo Habkost , "Michael S. Tsirkin" , Stefan Hajnoczi , "patches@linaro.org" , QEMU Developers , qemu-arm , "qemu-ppc@nongnu.org" , Marcel Apfelbaum , Paolo Bonzini , David Gibson Peter Maydell writes: > On 21 February 2017 at 12:44, Igor Mammedov wrote: >> If we are to ditch legacy approach, >> It would be cleaner for SoC to have fixed/unconfigurable >> CPU type and each SoC being modeled as a separate >> QOM object/type that would instantiate CPU directly >> with QOM style, using type name, like: >> >> cpu = object_new(TYPE_FOO_CPU) >> set props if necessary >> object_property_set_bool(cpu, true, "realized", &err) >> object_unref(cpu) >> >> or similar with extra check/logic on top of plain object_new() >> >> prepare cpu_opts for cpu type TYPE_FOO_CPU >> cpu = qdev_device_add(cpu_opts) >> object_unref(cpu) >> >> instead of using cpu_init/cpu_foo_init/cpu_generic_init() >> with cpu_model parsing logic which is not really needed >> there as concrete SoC model knows exact CPU type. > > Mmm, I think that's probably best. Would the end-user > still be able to set CPU properties if necessary via > a -global command line switch (since -cpu type,foo=on > wouldn't work)? -global is a qdev thing. It affects only instances of TYPE_DEVICE and its subtypes. Since TYPE_CPU is one... > (I just worry slightly that we might have users doing > weird things which we'd break.) I suspect we'd hand out a foot or two of extra rope, in addition to the miles our users already got.