From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7sOl-0006D6-Re for qemu-devel@nongnu.org; Wed, 14 Mar 2012 13:54:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7sOP-0002eC-3U for qemu-devel@nongnu.org; Wed, 14 Mar 2012 13:54:07 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 14 Mar 2012 18:53:24 +0100 Message-Id: <1331747617-7837-1-git-send-email-afaerber@suse.de> In-Reply-To: <1330893156-26569-1-git-send-email-afaerber@suse.de> References: <1330893156-26569-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC 00/12] QOM'ify remaining CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Liu Jinsong , Jan Kiszka , "Peter A. G. Crosthwaite" , Max Filippov , "Edgar E. Iglesias" , Khansa Butt , Jia Liu , Alexander Graf , qemu-ppc , John Williams , Eduardo Habkost , Paul Brook , Anthony Liguori , Richard Henderson , Blue Swirl , Lai Jiangshan , Vasilis Liaskovitis , Michael Walle , Igor Mammedov , Meador Inge , =?UTF-8?q?Andreas=20F=C3=A4rber?= , =?UTF-8?q?Aur=C3=A9lien=20Jarno?= Hello, Based on qom-cpu v4 and object_class_get_list() v2, this series converts the remaining CPUs to QOM. Their only intersection point is Makefile.targ= et. TODO: Review LGPLv2.1 text differences (bug in German GNU webpage). TODO: Check that cpu_model_str is set correctly everywhere. target-i386: Eduardo Habkost has already pointed out that it might be better to use QOM properties for -cpudef in target-i386, so that we use the same code p= aths internally as QMP users or machine compatibility code would. Cc: Eduardo Habkost Cc: Igor Mammedov Cc: Jan Kiszka Cc: Liu Jinsong Cc: Lai Jiangshan Cc: Vasilis Liaskovitis (Sorry if I forget someone.) target-ppc: As already discussed with Alex, I didn't manage to split out the QOM Powe= rPCCPU into cpu.c from translate.c #including translate_init.c within a reasonab= le time, so this becomes an exception in Makefile.target in the follow-up series. The initfn/uninitfn can be simplified in v2 by putting them in powerpc_cp= u_info. Cc: Alexander Graf Cc: qemu-ppc target-xtensa: Xtensa was problematic in that it used declarative definitions for Xtensa= Config whose macros I did not manage to convert to an imperative class_init with reasonable effort. I therefore resorted to a really ugly memcpy(), better= ideas or follow-up patches welcome! Cc: Max Filippov Cc: Anthony Liguori target-mips: Note that MIPSCPU conflicts with an in-flight FPU reset fix from Khansa a= nd Mentor and with ASE DSP series by Jia Liu. Cc: Khansa Butt Cc: Meador Inge Cc: Jia Liu Cc: Aur=C3=A9lien Jarno Most conversions were pretty straightforward. Pattern was always: * Add a new cpu-qom.h header to entangle QOM data and cpu.h #defines * Add a new cpu.c file implement FooCPU, FooCPUClass * If available, move list of CPU models into FooCPUInfo cpus[] in cpu.c * Embed CPUFooState as member of FooCPU * Define ENV_GET_OBJECT(env) macro * Make cpu-qom.h globally available through cpu.h (for now) * Move cpu_foo_init() code into foo_cpu_initfn() * Change cpu_foo_init() to use object_new() with a CPU type =3D> Some parts remain that might be moved into initfn in follow-ups. * Move cpu_foo_reset() code into foo_cpu_reset() * Let cpu_foo_reset() just call cpu_reset() * If implemented, change cpu_foo_list_cpu() to get, sort, print GSList of= FooCPUClass =3D> This may change the sometimes arbitrary order in user-visible -cpu= ? output. * If any, fix cpu.h vs. cpu-qom.h circular dependency issues through stat= ic inline helpers Available at: http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-cpu-others.= v1 Regards, Andreas target-alpha: Cc: Richard Henderson target-cris: target-microblaze: Cc: Edgar E. Iglesias Cc: Peter A. G. Crosthwaite Cc: John Williams target-lm32: Cc: Michael Walle target-m68k: Cc: Paul Brook target-s390x: Cc: Alexander Graf Cc: Ulrich Hecht target-sparc: Cc: Blue Swirl Andreas F=C3=A4rber (12): target-s390x: QOM'ify CPU target-mips: QOM'ify CPU target-m68k: QOM'ify CPU target-alpha: QOM'ify CPU target-i386: QOM'ify CPU target-ppc: QOM'ify CPU target-ppc: Prepare finalizer for PowerPCCPU target-cris: QOM'ify CPU target-lm32: QOM'ify CPU target-microblaze: QOM'ify CPU target-sparc: QOM'ify CPU target-xtensa: QOM'ify CPU Makefile.target | 14 +- gdbstub.c | 19 +- hw/xtensa_pic.c | 51 +- target-alpha/cpu-qom.h | 74 ++ target-alpha/cpu.c | 127 ++++ target-alpha/cpu.h | 1 + target-alpha/translate.c | 60 +-- target-cris/cpu-qom.h | 73 ++ target-cris/cpu.c | 144 ++++ target-cris/cpu.h | 2 + target-cris/translate.c | 93 ++-- target-i386/cpu-qom.h | 87 +++ target-i386/cpu.c | 1598 +++++++++++++++++++++++++++++++++++= ++++++ target-i386/cpu.h | 6 +- target-i386/cpuid.c | 1369 ----------------------------------- target-i386/helper.c | 101 +--- target-lm32/cpu-qom.h | 77 ++ target-lm32/cpu.c | 188 +++++ target-lm32/cpu.h | 1 + target-lm32/helper.c | 142 +--- target-m68k/cpu-qom.h | 75 ++ target-m68k/cpu.c | 161 +++++ target-m68k/cpu.h | 1 + target-m68k/helper.c | 158 ++--- target-microblaze/cpu-qom.h | 71 ++ target-microblaze/cpu.c | 120 +++ target-microblaze/cpu.h | 2 + target-microblaze/translate.c | 58 +-- target-mips/cpu-qom.h | 110 +++ target-mips/cpu.c | 806 +++++++++++++++++++++ target-mips/cpu.h | 2 +- target-mips/translate.c | 183 ++---- target-mips/translate_init.c | 594 --------------- target-ppc/cpu-qom.h | 84 +++ target-ppc/cpu.h | 26 +- target-ppc/helper.c | 73 +-- target-ppc/kvm.c | 30 +- target-ppc/kvm_ppc.h | 6 - target-ppc/translate.c | 2 +- target-ppc/translate_init.c | 270 ++++++- target-s390x/cpu-qom.h | 71 ++ target-s390x/cpu.c | 96 +++ target-s390x/cpu.h | 5 + target-s390x/helper.c | 42 +- target-sparc/cpu-qom.h | 95 +++ target-sparc/cpu.c | 949 ++++++++++++++++++++++++ target-sparc/cpu.h | 29 +- target-sparc/cpu_init.c | 848 ---------------------- target-sparc/int32_helper.c | 5 +- target-sparc/ldst_helper.c | 19 +- target-sparc/mmu_helper.c | 4 +- target-sparc/translate.c | 4 +- target-sparc/win_helper.c | 3 +- target-xtensa/core-dc232b.c | 5 +- target-xtensa/core-fsf.c | 5 +- target-xtensa/cpu-qom.h | 186 +++++ target-xtensa/cpu.c | 87 +++ target-xtensa/cpu.h | 125 +--- target-xtensa/helper.c | 151 +++-- target-xtensa/op_helper.c | 104 ++- target-xtensa/overlay_tool.h | 28 +- target-xtensa/translate.c | 9 +- 62 files changed, 6059 insertions(+), 3870 deletions(-) create mode 100644 target-alpha/cpu-qom.h create mode 100644 target-alpha/cpu.c create mode 100644 target-cris/cpu-qom.h create mode 100644 target-cris/cpu.c create mode 100644 target-i386/cpu-qom.h create mode 100644 target-i386/cpu.c delete mode 100644 target-i386/cpuid.c create mode 100644 target-lm32/cpu-qom.h create mode 100644 target-lm32/cpu.c create mode 100644 target-m68k/cpu-qom.h create mode 100644 target-m68k/cpu.c create mode 100644 target-microblaze/cpu-qom.h create mode 100644 target-microblaze/cpu.c create mode 100644 target-mips/cpu-qom.h create mode 100644 target-mips/cpu.c delete mode 100644 target-mips/translate_init.c create mode 100644 target-ppc/cpu-qom.h create mode 100644 target-s390x/cpu-qom.h create mode 100644 target-s390x/cpu.c create mode 100644 target-sparc/cpu-qom.h create mode 100644 target-sparc/cpu.c delete mode 100644 target-sparc/cpu_init.c create mode 100644 target-xtensa/cpu-qom.h create mode 100644 target-xtensa/cpu.c --=20 1.7.7