From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: PCI passthrough resource remapping Date: Thu, 14 Jan 2010 21:09:32 +0200 Message-ID: <4B4F6BEC.8080801@redhat.com> References: <20100109024500.GB4727@localhost.localdomain> <20100110221538.GF4727@localhost.localdomain> <4B4F2359.9040100@redhat.com> <20100114152652.GI4727@localhost.localdomain> <4B4F3992.3000906@redhat.com> <20100114154716.GB17515@redhat.com> <4B4F3E4B.5030303@redhat.com> <20100114183132.GJ4727@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Alexander Graf , kvm@vger.kernel.org To: nemesis@icequake.net Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12801 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757474Ab0ANTJm (ORCPT ); Thu, 14 Jan 2010 14:09:42 -0500 In-Reply-To: <20100114183132.GJ4727@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On 01/14/2010 08:31 PM, Ryan C. Underwood wrote: > > On Thu, Jan 14, 2010 at 05:54:51PM +0200, Avi Kivity wrote: > >> On 01/14/2010 05:47 PM, Michael S. Tsirkin wrote: >> >>> >>>> Michael, I think 'DisINTx-' means the device is not PCI 2.3 compliant? >>>> >>> No it doesn't, just that interrupt disable bit is not set. >>> >> Thanks. Ryan, while kvm doesn't support assigning a device with >> shared interrupts now, in the future it will likely be possible to >> share it. You'll still need an iommu. >> > No IOMMU on this machine and this is all integrated hardware. > > This IOMMU requirement seems so strange. I used to pass through PCI > devices ages ago when using the DOSEMU emulator. It emulated PCI BIOS > functions and mapped the PCI config space and memory regions into the > emulator process. The device interrupt was grabbed and handled in the > emulator's kernel support, waking up the emulator when an interrupt came > in. > > I don't really know anything about kvm internals, but I'd like to > understand more about the particulars of the IOMMU requirement if you > don't mind. > PCI cards can access system memory directly. If you assign a card to a guest, the guest will program the card to transfer data to system memory using guest addresses; since guest addresses don't correspond to host addresses, memory corruption will ensue. Not sure about your experience with DOSEMU; maybe these devices were not dma capable. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.