From: Alexander Graf Subject: Re: PCI passthrough resource remapping Date: Fri, 15 Jan 2010 14:15:34 +0100 Message-ID: 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> <20100115131122.GP17978@reaktio.net> Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Ryan C. Underwood" , Avi Kivity , "Michael S. Tsirkin" , kvm@vger.kernel.org To: =?iso-8859-1?Q?Pasi_K=E4rkk=E4inen?= Return-path: Received: from cantor2.suse.de ([195.135.220.15]:42746 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754043Ab0AONPh convert rfc822-to-8bit (ORCPT ); Fri, 15 Jan 2010 08:15:37 -0500 In-Reply-To: <20100115131122.GP17978@reaktio.net> Sender: kvm-owner@vger.kernel.org List-ID: On 15.01.2010, at 14:11, Pasi K=E4rkk=E4inen wrote: > On Thu, Jan 14, 2010 at 12:31:32PM -0600, Ryan C. Underwood wrote: >>=20 >>=20 >> On Thu, Jan 14, 2010 at 05:54:51PM +0200, Avi Kivity wrote: >>> On 01/14/2010 05:47 PM, Michael S. Tsirkin wrote: >>>>=20 >>>>> Michael, I think 'DisINTx-' means the device is not PCI 2.3 compl= iant? >>>> No it doesn't, just that interrupt disable bit is not set. >>>=20 >>> 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. >>=20 >> No IOMMU on this machine and this is all integrated hardware. >>=20 >> This IOMMU requirement seems so strange. I used to pass through PCI >> devices ages ago when using the DOSEMU emulator. It emulated PCI BI= OS >> functions and mapped the PCI config space and memory regions into th= e >> emulator process. The device interrupt was grabbed and handled in t= he >> emulator's kernel support, waking up the emulator when an interrupt = came >> in. >>=20 >> I don't really know anything about kvm internals, but I'd like to >> understand more about the particulars of the IOMMU requirement if yo= u >> don't mind. >>=20 >=20 > Xen supports PCI passthrough to PV guests without IOMMU. This can cre= ate > security problems, since the guests get DMA access to physical hardwa= re, > but that's usually OK in the situations where you want to use PCI > passthrough on your desktop or on your development box. That's why there way PV support for DMA in KVM too, but it turned out t= o be rather unmaintained and hard to detect if it actually works. Becau= se if the guest then just didn't use the PV parts to remap its DMA regi= ons, your PCI card ended up writing into random host memory regions. WI= thout you knowing. Xen doesn't have that problem as badly as we do, because it can guarant= ee that a PV guest is PV aware. On KVM PV is an optional add-in. All gu= ests start off being fully virtualized. So we voted for dropping PV DMA support in KVM and just went with the I= OMMU only approach. In the long run that's a pretty straight-forward ha= rdware requirement. And if you're using KVM you're used to hardware req= uirements already anyways ;-). Alex