From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8ZFr-0001sO-QE for qemu-devel@nongnu.org; Thu, 02 Jun 2016 16:30:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8ZFm-0000z9-QP for qemu-devel@nongnu.org; Thu, 02 Jun 2016 16:30:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8ZFm-0000yB-I6 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 16:30:06 -0400 References: <1464012090-6477-1-git-send-email-marcel@redhat.com> <20160530134309.GB20746@pxdev.xzpeter.org> <574C4AB7.5090203@redhat.com> <20160531014422.GC20746@pxdev.xzpeter.org> From: Marcel Apfelbaum Message-ID: <57509749.4090105@redhat.com> Date: Thu, 2 Jun 2016 23:30:01 +0300 MIME-Version: 1.0 In-Reply-To: <20160531014422.GC20746@pxdev.xzpeter.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 0/2] enable iommu with -device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, pbonzini@redhat.com, mst@redhat.com, davidkiarie4@gmail.com, bd.aviv@gmail.com On 05/31/2016 04:44 AM, Peter Xu wrote: > On Mon, May 30, 2016 at 05:14:15PM +0300, Marcel Apfelbaum wrote: >> On 05/30/2016 04:43 PM, Peter Xu wrote: >>> On Mon, May 23, 2016 at 05:01:28PM +0300, Marcel Apfelbaum wrote: >>>> This is a proposal on how to create the iommu with >>>> '-device intel-iommu' instead of '-machine,iommu=on'. >>>> >>>> The device is part of the machine properties because we wanted >>>> to ensure it is created before any other PCI device. >>>> >>>> The alternative is to skip the bus_master_enable_region at >>>> the time the device is created. We can create this region >>>> at machine_done phase. (patch 1) >>>> >>>> Then we can enable sysbus devices for PC machines and make all the >>>> init steps inside the iommu realize function. (patch 2) >>>> >>>> The series is working, but a lot of issues are not resolved: >>>> - minimum testing was done >>>> - the iommu addr should be passed (maybe) in command line rather than hard-coded >>>> - enabling sysbus devices for PC machines is risky, I am not aware yet >>>> of the side effects of this modification. >>>> - I am not sure moving the bus_master_enable_region to machine_done >>>> is with no undesired effects. >>> >>> I gave it a shot on the patches and it works nicely (of course no >>> complex configurations, like hot plug). >>> >>> Could you help introduce what will bring us if we use "-device" rather >>> than "-M" options? Benefits I can see is that, we can specify >>> parameters with specific device, rather than messing them up in >>> "machine" options. Do we have any other benefits that I may have >>> missed? >> >> Hi Peter, >> Thanks for trying it! >> >> Mainly is about not hard-coding device options (e.g. PCI address for AMD IOMMU), >> but also to avoid having devices added as a side-effect of some machine option. >> This will bring as closer to a cleaner model of a modular machine. >> >> I plan to post a non-rfc version soon. > > I just thought about whether we should support multiple IOMMUs in the > future (never know whether there would be a use case for > that). This is an interesting scenario, we may find a need for multiple IOMMUs. I tried it a while ago, but the linux kernel has (had?) a known limitation supporting it, see: https://lkml.org/lkml/2015/11/22/100 Since is categorized as bug, it may be solved and the we can go for it. Anyway, looking forward to your non-rfc version. :) I just posted a new version. Thanks, Marcel > > Thanks! > > -- peterx >