From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QccYc-0008C5-Mk for qemu-devel@nongnu.org; Fri, 01 Jul 2011 08:10:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QccYa-0004Yj-HU for qemu-devel@nongnu.org; Fri, 01 Jul 2011 08:10:49 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:40418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QccYa-0004Yb-E5 for qemu-devel@nongnu.org; Fri, 01 Jul 2011 08:10:48 -0400 Received: by gyg10 with SMTP id 10so1530984gyg.4 for ; Fri, 01 Jul 2011 05:10:47 -0700 (PDT) Message-ID: <4E0DB945.4070203@codemonkey.ws> Date: Fri, 01 Jul 2011 07:10:45 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <9F6FE96B71CF29479FF1CDC8046E1503165EEB@039-SN1MPN1-003.039d.mgd.msft.net> <1309481894.14501.230.camel@pasglop> In-Reply-To: <1309481894.14501.230.camel@pasglop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] device assignment for embedded Power List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Alexander Graf , Wood Scott-B07421 , "joerg.roedel@amd.com" , "qemu-devel@nongnu.org" , "dwg@au1.ibm.com" , "blauwirbel@gmail.com" , Yoder Stuart-B08248 , "alex.williamson@redhat.com" , "paul@codesourcery.com" , "armbru@redhat.com" On 06/30/2011 07:58 PM, Benjamin Herrenschmidt wrote: > On Thu, 2011-06-30 at 15:59 +0000, Yoder Stuart-B08248 wrote: >> This avoids needing to pass the host device tree, but could >> get awkward-- the i2c example above is very simple, some device >> nodes are very large with a complex hierarchy of subnodes and >> could be hundreds of lines of text to represent a single >> node. >> >> It gets more complicated... > > > So, from a qemu command line perspective, all you should have to do is > pass qemu the device-tree -path- to the device you want to pass-trough > (you may support passing a full hierarchy here). I agree in principle but I think it should be done in a slightly different way. I think we ought to support composing a device by passthrough. For instance, something like: [physical-device "mydev"] region[0].file = "/dev/mem" region[0].guest_address = "0x42232000" region[0].file_offset = "0x23423400" region[0].size = "4096" irq[0].guest_irq = "10" irq[0].host_irq = "10" This should be independent of anything to do with device tree. This would be useful for x86 too to assign platform devices (like the HPET). I think there should be a separate mechanism to manipulate the guest device tree, just like there are mechanisms to manipulate the guest's ACPI tables. Given these two mechanisms, there should be a simple command line like Ben has suggested that just takes a host device tree path and Just Works. It really is just a convenience interface though. With raw mechanisms like I described above, it would give you the flexibility to pass through a device with a modified host tree fragment without having an overly complicated command line interface for the more common case. Regards, Anthony Liguori