From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzYjz-0007Zw-Lg for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:04:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzYju-0007XM-Cf for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:04:02 -0400 Received: from [199.232.76.173] (port=39903 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzYju-0007XB-7A for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:03:58 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:59687) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LzYjs-0003Hw-Ul for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:03:57 -0400 Received: from pike.pond.sub.org (pD9E38364.dip.t-dialin.net [217.227.131.100]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 7C27F2DD257 for ; Thu, 30 Apr 2009 18:03:54 +0200 (CEST) From: Markus Armbruster Date: Thu, 30 Apr 2009 18:03:44 +0200 Message-Id: Subject: [Qemu-devel] [RFC PATCH 0/4] Machine description as data List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Tenth iteration of the prototype. Work in progress, not quite ready for merging. Four parts, parts 1 and 2 are cleanups (could be applied right away), part 3 is straightforward preparation, and part 4 is the prototype: [PATCH 1/4] Confine use of global rtc_state to PC CMOS functions [PATCH 2/4] Remove global floppy_controller [PATCH 3/4] Give parse_macaddr() external linkage [PATCH 4/4] Machine description as data New: * Bunch PIC and I/O APIC together in the tree, to keep the interrupt graph a tree. * Reduce device initialization dependencies. Such dependencies arise when device A exposes its innards, typically in global variables, and device B rummages through them. A then has to be initialized before B. Fine if A is a parent of B (but even then, global variables are gauche), not so fine if they're siblings. * Property "unit-address". Recognized only for PCI devices so far, and implemented only by PIIX3. * Rebased to commit 0ecdb16ef01ffbff7e5c88872e885c9f6c6e89c7. Shortcuts: * No support for systems lacking PCI bus or APIC. * I didn't implement all the devices of the "pc" original. Missing: - Audio - RAM above 4g * The configuration tree is simplistic. I expect it to evolve, and I wouldn't exclude the possibility of wholesale replacement. * The initial configuration tree is hardcoded in dt_hardcoded_config(). It should be read from a configuration file. * The new, unified device API is implemented as wrappers around the old APIs. Done that way because we want to explore the new API with minimal impact to the rest of the code. Once we're satisfied with the new API, the old APIs should be replaced. * A bus is identified by its kind and number. The bus number depends on its position in the tree. Means for position-independent addressing would be nice. * The interface to the shared code in hw/pc.c (hw/pcint.h) is rather crude. * The pc-misc driver should be split up completely. * BIOS larger than 128KiB isn't implemented. pc.c loads the BIOS once and maps it in two locations. pcdt.c loads and maps it twice. * PCI interrupt routing from LNKA..LNKD to GSIs ist not yet represented. * Requires -disable-kqemu, because USE_KQEMU adds a dependence through global variable first_cpu. Not in, but not forgotten either: * A few more renames suggested by reviewers. * Reduce unnecessary differences to IEEE 1275 trees. Bugs (last checked in 7th iteration): * hw/ppce500_mpc8544ds.c doesn't compile when I configure with fdt support. * If I configure both a virtio block device and a virtio console, the Linux guest kernel hangs. The same happens when I move virtio code in pc.c in an otherwise unmodified QEMU so that balloon and console are initialized earlier. Markus Armbruster (4): Confine use of global rtc_state to PC CMOS functions Remove global floppy_controller Give parse_macaddr() external linkage Machine description as data Makefile | 1 + Makefile.target | 7 +- dt-fdt.c | 123 +++++++ dt-host.c | 176 +++++++++ dt.c | 600 +++++++++++++++++++++++++++++++ dt.h | 150 ++++++++ hw/boards.h | 3 + hw/fdc.c | 76 +++-- hw/fdc.h | 2 +- hw/pc.c | 78 ++--- hw/pcdt.c | 941 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/pcidt.c | 67 ++++ hw/pcint.h | 47 +++ net.c | 2 +- net.h | 1 + target-i386/machine.c | 1 + tree.c | 285 +++++++++++++++ tree.h | 41 +++ 18 files changed, 2522 insertions(+), 79 deletions(-) create mode 100644 dt-fdt.c create mode 100644 dt-host.c create mode 100644 dt.c create mode 100644 dt.h create mode 100644 hw/pcdt.c create mode 100644 hw/pcidt.c create mode 100644 hw/pcint.h create mode 100644 tree.c create mode 100644 tree.h