Received: from eggs.gnu.org ([208.118.235.92]:43972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg0JK-00085Q-SH for qemu-devel@nongnu.org; Tue, 04 Dec 2012 16:45:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfvWl-0003fU-Co for qemu-devel@nongnu.org; Tue, 04 Dec 2012 11:39:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfvWl-0003fP-1H for qemu-devel@nongnu.org; Tue, 04 Dec 2012 11:39:23 -0500 Date: Tue, 4 Dec 2012 14:40:47 -0200 From: Eduardo Habkost Message-ID: <20121204164047.GL4255@otherpad.lan.raisama.net> References: <1354627180-25704-1-git-send-email-ehabkost@redhat.com> <50BE1DEA.30303@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50BE1DEA.30303@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 0/8] CPU DeviceState v9 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Peter Maydell , Riku Voipio , qemu-devel@nongnu.org, Anthony Liguori , Paolo Bonzini , Igor Mammedov On Tue, Dec 04, 2012 at 04:59:38PM +0100, Andreas F=E4rber wrote: > Am 04.12.2012 14:19, schrieb Eduardo Habkost: > > Changes on v9: > > - Instead of moving qemu_[un]register_reset() to reset.c and includi= ng > > it on *-user, create stubs for them on libqemustub.a >=20 > We compile cpu.c twice. Can't we do the same for qdev.c or whatever use= s > those functions? I feel they have no business being used in *-user. > CC'ing Riku and Peter. I don't understand what exactly you are suggesting. You suggest adding #ifdefs to qdev.c to compile out the qemu_[un]register_reset() calls? I had a version of this series that did exactly that[1], but IIRC somebody suggested using stub functions instead. And I agree with whoever suggested it, I believe stub functions are cleaner when the the stub version still have the semantics expected by the caller[2]. [1] http://article.gmane.org/gmane.comp.emulators.xen.devel/137686 [2] e.g. a no-op qemu_register_reset() still does the job it's supposed to do (making sure a function to be called when qemu_devices_reset() is called), if we know qemu_devices_reset() is never called. >=20 > Andreas >=20 > > - This is based on afaerber's qom-cpu branch, that has some header c= leanup > > changes. You can get the complete series in a git tree at: > > https://github.com/ehabkost/qemu-hacks/tree/cpu_qdev.v9 > > git://github.com/ehabkost/qemu-hacks.git cpu_qdev.v9 > >=20 > > v8: > > - Use a simpler copyright header on qdev-properties-system.c > > - Use the new libqemustub.a mechanism instead of the (now exting) > > QEMU_WEAK_ALIAS mechanism > > - Move the reset-handler registration code to a new hw/reset.c file > >=20 > > v7: > > - Use the new QEMU_WEAK_ALIAS mechanism instead of the (now extinct) > > GCC_WEAK attribute (patches 20 and 21) > >=20 > > v6: > > - Simple rebase against latest qemu.git master > > - Patch 13: some new typedefs were added and others were removed > > - Patch 19: trivial rebase > > v5: > > - Tons of header cleanups just to eliminate qlist.h <-> cpu-common.h= circular > > dependency (patches 1-17) > > - Add copyright/license information to qdev-properties.c (patch 17) > > - Add copyright/license information to qdev-properties-system.c (pat= ch 22) > > - use error_report()+abort() instead of hw_error() on qdev.c (patch = 18) > > - Move qemu_[un]register_reset() and qemu_devices_reset() to qdev-co= re.c > > (patch 19) > > - Make vmstate_[un]register() weak stubs, instead of a new function = (patch 20) > > - Make sysbus_get_default() weak stub, instead of new qbus reset (un= )register > > functions (patch 21) > > - Eliminate qdev-system.c (all code is kept on qdev.c, now) (patch 2= 2) > > v4: > > - Add GCC_WEAK_DECL to functions that have GCC_WEAK versions > > - Updated the qdev_init_gpio_in() code on qdev-system.c to current = version > > - Patch description updates (moved changelog below "---" and/or mov= e info > > about changes made by different authors between SoB lines) > > v3 (submitted by Igor): > > - rebased on top of 8b4a3df (today's master) > > - slight code reshuffling in (see commit's changelog) > > "qdev: separate core from the code used only by qemu-system-*" > > "move qemu_irq typedef out of cpu-common.h" > > - commit messages cleanup > > v2: > > Removes the CONFIG_USER_ONLY ifdefs, and use weak symbols to move > > the vmstate and qemu_register_reset() handling to qdev-system.c > >=20 > > git tree for testing: > > https://github.com/ehabkost/qemu-hacks/tree/cpu_qdev.v9 > > git://github.com/ehabkost/qemu-hacks.git cpu_qdev.v9 > >=20 > > References to previous versions: > > v8: http://article.gmane.org/gmane.comp.emulators.qemu/182589 > > v7: http://article.gmane.org/gmane.comp.emulators.qemu/179969 > > v6: http://article.gmane.org/gmane.comp.emulators.qemu/179918 > > v5: http://article.gmane.org/gmane.comp.emulators.qemu/177426 > > v4: http://article.gmane.org/gmane.comp.emulators.qemu/176127 > > v3: http://article.gmane.org/gmane.comp.emulators.qemu/175980 > > v2: http://article.gmane.org/gmane.comp.emulators.qemu/173909 > > v1: http://article.gmane.org/gmane.comp.emulators.qemu/166630 > >=20 > >=20 > > Eduardo Habkost (7): > > move -I$(SRC_PATH)/include compiler flag to Makefile.objs > > qdev: qdev_create(): use error_report() instead of hw_error() > > libqemustub: add qemu_[un]register_reset() stubs > > libqemustub: vmstate register/unregister stubs > > libqemustub: sysbus_get_default() stub > > qdev-properties.c: separate core from the code used only by > > qemu-system-* > > include qdev code into *-user, too > >=20 > > Igor Mammedov (1): > > qom: make CPU a child of DeviceState > >=20 > > Makefile | 1 - > > Makefile.objs | 23 ++- > > hw/Makefile.objs | 10 +- > > hw/qdev-properties-system.c | 352 ++++++++++++++++++++++++++++++++++= ++++++++++ > > hw/qdev-properties.c | 321 +---------------------------------= ------ > > hw/qdev-properties.h | 1 + > > hw/qdev.c | 21 +-- > > include/qemu/cpu.h | 6 +- > > qom/cpu.c | 3 +- > > stubs/Makefile.objs | 3 + > > stubs/reset.c | 13 ++ > > stubs/sysbus.c | 6 + > > stubs/vmstate.c | 17 +++ > > 13 files changed, 428 insertions(+), 349 deletions(-) > > create mode 100644 hw/qdev-properties-system.c > > create mode 100644 stubs/reset.c > > create mode 100644 stubs/sysbus.c > > create mode 100644 stubs/vmstate.c > >=20 >=20 >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg --=20 Eduardo