From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L16O3-0005Lf-D4 for qemu-devel@nongnu.org; Fri, 14 Nov 2008 16:39:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L16O2-0005K5-A4 for qemu-devel@nongnu.org; Fri, 14 Nov 2008 16:39:31 -0500 Received: from [199.232.76.173] (port=48901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L16O2-0005Jz-6p for qemu-devel@nongnu.org; Fri, 14 Nov 2008 16:39:30 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:45522) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L16O1-0007HY-W5 for qemu-devel@nongnu.org; Fri, 14 Nov 2008 16:39:30 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mAELdFUR031626 for ; Fri, 14 Nov 2008 16:39:15 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mAELdPCu115674 for ; Fri, 14 Nov 2008 16:39:25 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mAELdOAV017875 for ; Fri, 14 Nov 2008 16:39:25 -0500 From: Hollis Blanchard Subject: Re: [Qemu-devel] Machine config files Date: Fri, 14 Nov 2008 15:39:23 -0600 References: <200811140332.14093.paul@codesourcery.com> <200811141351.40613.hollisb@us.ibm.com> <491DDB74.5070701@codemonkey.ws> In-Reply-To: <491DDB74.5070701@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811141539.23408.hollisb@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: devicetree-discuss@ozlabs.org, qemu-devel@nongnu.org On Friday 14 November 2008 14:11:32 Anthony Liguori wrote: > Hollis Blanchard wrote: > > We do; PLB, OPB, and EBC are all on-chip busses found on IBM PowerPC SoCs. For > > example, you can see devices representing the UARTs and PCI controller in our > > bamboo.dts file. Qemu only modifies the device tree at runtime with > > information not known until then (memory size, clock frequency, etc). > > > > Yes, but you don't build the machine based on the device tree. What > would be useful would be to be able to simply write a device tree > description and that would fully represent the board such that you > didn't need a ppc440_bamboo.c file at all. > > So what I'm getting at is, what is preventing us from being able to do > this today? Theoretically, nothing. If qemu were a clean and modular place, it would probably be pretty straightforward. Some translation code would be required for compatibility. For example, when the DTS has 128MB of memory, and the user invokes qemu with -m 256, now you need to update the device tree in order to pass it into the guest. That's pretty easy, but once you start talking about adding PCI devices it gets a little more difficult. I seem to recall this conversation was had on qemu-devel a little while back. Of course, *some* code would still be needed *somewhere* to load the kernel, initrd, set initial register state to point to those memory locations, etc. In the case of KVM on 440, we also need to override the DTS with the real host clock frequency. (This probably isn't necessary for qemu+TCG.) But yes, replacing all the pci_nic_init(), isa_mmio_init(), cpu_register_physical_memory(), etc could be automated by walking the device tree. -- Hollis Blanchard IBM Linux Technology Center