On Sat, Jun 18, 2016 at 02:34:26PM +0200, Jan Kiszka wrote: > On 2016-06-18 14:32, Peter Xu wrote: > > On Sat, Jun 18, 2016 at 11:18:29AM +0300, David Kiarie wrote: [...] > >> I missed this is the last version of the patch I should fix it in next > >> version. > >> > >> On taking a closer look at this there might be larger problem where > >> with the advent of -device <iommu-type> users can possibly emulate two > >> IOMMUs at the same time ? A proposed solution was to have > >> pci_setup_iommu check that DMA hook as not been setup yet and fail if > >> yes. I should send a fix for that too. > > > > Currently we should only support single vIOMMU. If you are going to > > rebase to x86-iommu codes, there is a patch that includes the check: > > > > "[PATCH v9 02/25] x86-iommu: provide x86_iommu_get_default" > > > > by: > > > > assert(x86_iommu_default == NULL); > > > > Maybe we should print something more readable, like "multiple vIOMMUs > > are not supported yet", rather than an assertion fail. > > You need proper error handling and a readable error message because > nothing else will stop the user from doing -device intel-iommu -device > amd-iommu.
Will do. Thanks. -- peterx