Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-10 Thread Jason Wang
On 2017年03月09日 23:32, Paolo Bonzini wrote: On 09/03/2017 16:31, Michael S. Tsirkin wrote: On Thu, Mar 09, 2017 at 11:05:36AM +0100, Paolo Bonzini wrote: On 09/03/2017 10:58, Jason Wang wrote: On 2017年03月09日 17:28, Igor Mammedov wrote: On Thu, 9 Mar 2017 10:32:44 +0800 Jason

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-09 Thread Paolo Bonzini
On 09/03/2017 16:31, Michael S. Tsirkin wrote: > On Thu, Mar 09, 2017 at 11:05:36AM +0100, Paolo Bonzini wrote: >> >> >> On 09/03/2017 10:58, Jason Wang wrote: >>> >>> >>> On 2017年03月09日 17:28, Igor Mammedov wrote: On Thu, 9 Mar 2017 10:32:44 +0800 Jason Wang

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-09 Thread Michael S. Tsirkin
On Thu, Mar 09, 2017 at 11:05:36AM +0100, Paolo Bonzini wrote: > > > On 09/03/2017 10:58, Jason Wang wrote: > > > > > > On 2017年03月09日 17:28, Igor Mammedov wrote: > >> On Thu, 9 Mar 2017 10:32:44 +0800 > >> Jason Wang wrote: > >> > >>> On 2017年03月09日 00:40, Igor Mammedov

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-09 Thread Paolo Bonzini
On 09/03/2017 10:58, Jason Wang wrote: > > > On 2017年03月09日 17:28, Igor Mammedov wrote: >> On Thu, 9 Mar 2017 10:32:44 +0800 >> Jason Wang wrote: >> >>> On 2017年03月09日 00:40, Igor Mammedov wrote: On Tue, 7 Mar 2017 14:47:30 +0200 Marcel

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-09 Thread Jason Wang
On 2017年03月09日 17:28, Igor Mammedov wrote: On Thu, 9 Mar 2017 10:32:44 +0800 Jason Wang wrote: On 2017年03月09日 00:40, Igor Mammedov wrote: On Tue, 7 Mar 2017 14:47:30 +0200 Marcel Apfelbaum wrote: On 03/07/2017 11:09 AM, Jason Wang wrote: After

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-09 Thread Paolo Bonzini
On 09/03/2017 10:28, Igor Mammedov wrote: > On Thu, 9 Mar 2017 10:32:44 +0800 > Jason Wang wrote: > >> On 2017年03月09日 00:40, Igor Mammedov wrote: >>> On Tue, 7 Mar 2017 14:47:30 +0200 >>> Marcel Apfelbaum wrote: >>> On 03/07/2017 11:09 AM, Jason

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-09 Thread Igor Mammedov
On Thu, 9 Mar 2017 10:32:44 +0800 Jason Wang wrote: > On 2017年03月09日 00:40, Igor Mammedov wrote: > > On Tue, 7 Mar 2017 14:47:30 +0200 > > Marcel Apfelbaum wrote: > > > >> On 03/07/2017 11:09 AM, Jason Wang wrote: > >>> After commit 96a8821d2141

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Jason Wang
On 2017年03月09日 00:40, Igor Mammedov wrote: On Tue, 7 Mar 2017 14:47:30 +0200 Marcel Apfelbaum wrote: On 03/07/2017 11:09 AM, Jason Wang wrote: After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring translations"), IOMMU was required to be

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Igor Mammedov
On Tue, 7 Mar 2017 14:47:30 +0200 Marcel Apfelbaum wrote: > On 03/07/2017 11:09 AM, Jason Wang wrote: > > After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU > > after caching ring translations"), IOMMU was required to be created in > > advance. This is because

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Marcel Apfelbaum
On 03/08/2017 11:16 AM, Peter Xu wrote: On Wed, Mar 08, 2017 at 05:09:45PM +0800, Peter Xu wrote: On Wed, Mar 08, 2017 at 10:17:09AM +0200, Marcel Apfelbaum wrote: [...] I am sorry I was not clear enough: If a device is added after the system is up (hotplug), we cannot depend on the

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Jason Wang
On 2017年03月08日 16:17, Marcel Apfelbaum wrote: On 03/08/2017 05:15 AM, Jason Wang wrote: On 2017年03月08日 10:43, Peter Xu wrote: On Tue, Mar 07, 2017 at 02:47:30PM +0200, Marcel Apfelbaum wrote: On 03/07/2017 11:09 AM, Jason Wang wrote: After commit 96a8821d2141 ("virtio: unbreak virtio-pci

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Peter Xu
On Wed, Mar 08, 2017 at 05:09:45PM +0800, Peter Xu wrote: > On Wed, Mar 08, 2017 at 10:17:09AM +0200, Marcel Apfelbaum wrote: > > [...] > > > > > I am sorry I was not clear enough: > > If a device is added after the system is up (hotplug), we cannot depend on > > the "machine_done" > > event

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Peter Xu
On Wed, Mar 08, 2017 at 10:17:09AM +0200, Marcel Apfelbaum wrote: [...] > > I am sorry I was not clear enough: > If a device is added after the system is up (hotplug), we cannot depend on > the "machine_done" > event to enable "bus master". > This is why we have >if (qdev_hotplug) >

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Marcel Apfelbaum
On 03/08/2017 04:43 AM, Peter Xu wrote: On Tue, Mar 07, 2017 at 02:47:30PM +0200, Marcel Apfelbaum wrote: On 03/07/2017 11:09 AM, Jason Wang wrote: After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring translations"), IOMMU was required to be created in advance.

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-08 Thread Marcel Apfelbaum
On 03/08/2017 05:15 AM, Jason Wang wrote: On 2017年03月08日 10:43, Peter Xu wrote: On Tue, Mar 07, 2017 at 02:47:30PM +0200, Marcel Apfelbaum wrote: On 03/07/2017 11:09 AM, Jason Wang wrote: After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring translations"),

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-07 Thread Jason Wang
On 2017年03月08日 10:43, Peter Xu wrote: On Tue, Mar 07, 2017 at 02:47:30PM +0200, Marcel Apfelbaum wrote: On 03/07/2017 11:09 AM, Jason Wang wrote: After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring translations"), IOMMU was required to be created in advance.

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-07 Thread Peter Xu
On Tue, Mar 07, 2017 at 02:47:30PM +0200, Marcel Apfelbaum wrote: > On 03/07/2017 11:09 AM, Jason Wang wrote: > >After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU > >after caching ring translations"), IOMMU was required to be created in > >advance. This is because we can only get

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-07 Thread Marcel Apfelbaum
On 03/07/2017 11:09 AM, Jason Wang wrote: After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring translations"), IOMMU was required to be created in advance. This is because we can only get the correct dma_as after pci IOMMU (e.g intel_iommu) was initialized. This

Re: [Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-07 Thread Peter Xu
On Tue, Mar 07, 2017 at 05:09:11PM +0800, Jason Wang wrote: > After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU > after caching ring translations"), IOMMU was required to be created in > advance. This is because we can only get the correct dma_as after pci > IOMMU (e.g intel_iommu)

[Qemu-devel] [PATCH V3] virtio: do not require IOMMU to be created in advance

2017-03-07 Thread Jason Wang
After commit 96a8821d2141 ("virtio: unbreak virtio-pci with IOMMU after caching ring translations"), IOMMU was required to be created in advance. This is because we can only get the correct dma_as after pci IOMMU (e.g intel_iommu) was initialized. This is suboptimal and inconvenient for user. This