From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qcdr4-0004F1-8d for qemu-devel@nongnu.org; Fri, 01 Jul 2011 09:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qcdqx-0001fA-FK for qemu-devel@nongnu.org; Fri, 01 Jul 2011 09:33:57 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:63551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qcdqx-0001ev-49 for qemu-devel@nongnu.org; Fri, 01 Jul 2011 09:33:51 -0400 Received: by pzk30 with SMTP id 30so3337955pzk.4 for ; Fri, 01 Jul 2011 06:33:49 -0700 (PDT) Message-ID: <4E0DCCB6.505@codemonkey.ws> Date: Fri, 01 Jul 2011 08:33:42 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <9F6FE96B71CF29479FF1CDC8046E1503165EEB@039-SN1MPN1-003.039d.mgd.msft.net> <1309481894.14501.230.camel@pasglop> <4E0DB945.4070203@codemonkey.ws> <201107011352.37482.paul@codesourcery.com> In-Reply-To: <201107011352.37482.paul@codesourcery.com> 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: Paul Brook Cc: Wood Scott-B07421 , "joerg.roedel@amd.com" , "qemu-devel@nongnu.org" , Alexander Graf , "blauwirbel@gmail.com" , Yoder Stuart-B08248 , "alex.williamson@redhat.com" , "dwg@au1.ibm.com" , "armbru@redhat.com" On 07/01/2011 07:52 AM, Paul Brook wrote: >>> 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'm not quite sure what you're getting at here. IMO there should be little or > no need for special knowledge of passthrough devices. They should just be > annother qdev device, configured in the normal way. e.g.: > -device sysbus-host,hostdev=whatever,normal_mmio_and_irq_config What I wrote about is just readconfig syntax. It's the same as: -device physical-device,id=mydev,region[0].file=/dev/mem,.... Regards, Anthony Liguori >> 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. > > I aggree. Any sort of device tree (IIUC ACPI tables are in principle giving > the same information) is, in practice, going to need to be assembled at > runtime. This needs some mechanism for devices to describe themselves, > probably largely independent of actual machine/device creation code. > > We've got away without it thus far because the only real place where we have > nontrivial user-specified machine variants is on the PCI bus. Devices there > are for the most part self-describing so the guest firmware/OS can probe > hardware itself. > > Paul >