Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-03-09 Thread Paolo Bonzini
On 09/03/2017 16:29, Michael S. Tsirkin wrote: >> If VFIO had an iommu property, to be used like "-device >> intel_iommu,id=iommu0 -device vfio-pci,iommu=iommu0", It could tell VFIO >> to use separate containers and also ensure proper ordering of command >> line arguments. > > Lots of guests can'

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-03-09 Thread Michael S. Tsirkin
On Thu, Mar 09, 2017 at 01:31:45PM +0100, Paolo Bonzini wrote: > > > On 23/02/2017 16:35, Alex Williamson wrote: > > It's the architecture of vfio, the user only gets access to the device > > when the container has iommu protection, therefore vfio needs to look > > at the device address space to

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-03-09 Thread Paolo Bonzini
On 23/02/2017 16:35, Alex Williamson wrote: > It's the architecture of vfio, the user only gets access to the device > when the container has iommu protection, therefore vfio needs to look > at the device address space to determine if it can share a container > with other devices. Without an iom

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-28 Thread Marcel Apfelbaum
On 02/23/2017 05:35 PM, Alex Williamson wrote: On Thu, 23 Feb 2017 14:02:07 +0200 Marcel Apfelbaum wrote: On 02/23/2017 10:16 AM, Peter Xu wrote: On Thu, Feb 23, 2017 at 10:10:57AM +0200, Marcel Apfelbaum wrote: On 02/23/2017 05:06 AM, Peter Xu wrote: On Wed, Feb 22, 2017 at 10:30:47AM -070

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Peter Xu
On Fri, Feb 24, 2017 at 01:21:52AM +0200, Michael S. Tsirkin wrote: > On Wed, Feb 22, 2017 at 01:49:25PM +0800, Peter Xu wrote: > > Intel vIOMMU devices are created with "-device" parameter, while here > > actually we need to make sure this device will be created before some > > other PCI devices (

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Michael S. Tsirkin
On Thu, Feb 23, 2017 at 01:42:34PM +0800, Peter Xu wrote: > On Wed, Feb 22, 2017 at 08:24:51PM -0700, Alex Williamson wrote: > > [...] > > > > Now Jintack reported another issue, that we may have two default > > > devices there if not specifying "-nodefaults", and that two devices > > > will alwa

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Michael S. Tsirkin
On Wed, Feb 22, 2017 at 01:49:25PM +0800, Peter Xu wrote: > Intel vIOMMU devices are created with "-device" parameter, while here > actually we need to make sure this device will be created before some > other PCI devices (like vfio-pci devices) so that we know iommu_fn will > be setup correctly be

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Alex Williamson
On Thu, 23 Feb 2017 14:02:07 +0200 Marcel Apfelbaum wrote: > On 02/23/2017 10:16 AM, Peter Xu wrote: > > On Thu, Feb 23, 2017 at 10:10:57AM +0200, Marcel Apfelbaum wrote: > >> On 02/23/2017 05:06 AM, Peter Xu wrote: > >>> On Wed, Feb 22, 2017 at 10:30:47AM -0700, Alex Williamson wrote: > >>

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Marcel Apfelbaum
On 02/23/2017 10:16 AM, Peter Xu wrote: On Thu, Feb 23, 2017 at 10:10:57AM +0200, Marcel Apfelbaum wrote: On 02/23/2017 05:06 AM, Peter Xu wrote: On Wed, Feb 22, 2017 at 10:30:47AM -0700, Alex Williamson wrote: On Wed, 22 Feb 2017 13:49:25 +0800 Peter Xu wrote: Intel vIOMMU devices are crea

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Peter Xu
On Thu, Feb 23, 2017 at 10:10:57AM +0200, Marcel Apfelbaum wrote: > On 02/23/2017 05:06 AM, Peter Xu wrote: > >On Wed, Feb 22, 2017 at 10:30:47AM -0700, Alex Williamson wrote: > >>On Wed, 22 Feb 2017 13:49:25 +0800 > >>Peter Xu wrote: > >> > >>>Intel vIOMMU devices are created with "-device" param

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-23 Thread Marcel Apfelbaum
On 02/23/2017 05:06 AM, Peter Xu wrote: On Wed, Feb 22, 2017 at 10:30:47AM -0700, Alex Williamson wrote: On Wed, 22 Feb 2017 13:49:25 +0800 Peter Xu wrote: Intel vIOMMU devices are created with "-device" parameter, while here actually we need to make sure this device will be created before so

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Peter Xu
On Wed, Feb 22, 2017 at 08:24:51PM -0700, Alex Williamson wrote: [...] > > Now Jintack reported another issue, that we may have two default > > devices there if not specifying "-nodefaults", and that two devices > > will always be the first ones to be inited. > > > > How about here we just expli

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Alex Williamson
On Thu, 23 Feb 2017 11:06:47 +0800 Peter Xu wrote: > On Wed, Feb 22, 2017 at 10:30:47AM -0700, Alex Williamson wrote: > > On Wed, 22 Feb 2017 13:49:25 +0800 > > Peter Xu wrote: > > > > > Intel vIOMMU devices are created with "-device" parameter, while here > > > actually we need to make sure

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Peter Xu
On Wed, Feb 22, 2017 at 10:30:47AM -0700, Alex Williamson wrote: > On Wed, 22 Feb 2017 13:49:25 +0800 > Peter Xu wrote: > > > Intel vIOMMU devices are created with "-device" parameter, while here > > actually we need to make sure this device will be created before some > > other PCI devices (like

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Peter Xu
On Wed, Feb 22, 2017 at 08:37:32AM -0500, Jintack Lim wrote: > On Wed, Feb 22, 2017 at 6:42 AM, Jintack Lim > wrote: > > > > > > > On Wed, Feb 22, 2017 at 12:49 AM, Peter Xu wrote: > > > >> Intel vIOMMU devices are created with "-device" parameter, while here > >> actually we need to make sure t

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Alex Williamson
On Wed, 22 Feb 2017 13:49:25 +0800 Peter Xu wrote: > Intel vIOMMU devices are created with "-device" parameter, while here > actually we need to make sure this device will be created before some > other PCI devices (like vfio-pci devices) so that we know iommu_fn will > be setup correctly before

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Jintack Lim
On Wed, Feb 22, 2017 at 6:42 AM, Jintack Lim wrote: > > > On Wed, Feb 22, 2017 at 12:49 AM, Peter Xu wrote: > >> Intel vIOMMU devices are created with "-device" parameter, while here >> actually we need to make sure this device will be created before some >> other PCI devices (like vfio-pci devi

Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-22 Thread Jintack Lim
On Wed, Feb 22, 2017 at 12:49 AM, Peter Xu wrote: > Intel vIOMMU devices are created with "-device" parameter, while here > actually we need to make sure this device will be created before some > other PCI devices (like vfio-pci devices) so that we know iommu_fn will > be setup correctly before r

[Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev

2017-02-21 Thread Peter Xu
Intel vIOMMU devices are created with "-device" parameter, while here actually we need to make sure this device will be created before some other PCI devices (like vfio-pci devices) so that we know iommu_fn will be setup correctly before realizations of those PCI devices. Here we do explicit check