Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-20 Thread Lan Tianyu
On 2017年04月20日 15:04, Peter Xu wrote: > On Thu, Apr 20, 2017 at 06:36:16AM +, Liu, Yi L wrote: > > [...] > In my understanding, container->space->as->root cannot work here no matter passthru-mode is enabled or not. The code here is aiming to check if vIOMMU exists. After the vf

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-20 Thread Peter Xu
On Thu, Apr 20, 2017 at 06:36:16AM +, Liu, Yi L wrote: [...] > > > In my understanding, container->space->as->root cannot work here no > > > matter passthru-mode is enabled or not. The code here is aiming to > > > check if vIOMMU exists. After the vfio series, the vtd_dev_as->root is > > > no

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-20 Thread Peter Xu
On Thu, Apr 20, 2017 at 02:51:11PM +0800, Lan, Tianyu wrote: > On 4/20/2017 1:40 PM, Peter Xu wrote: [...] > >>>a slightly hackish way. > >> > >>In my understanding, container->space->as->root cannot work here no matter > >>passthru-mode > >>is enabled or not. The code here is aiming to check if

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Lan, Tianyu
On 4/20/2017 1:40 PM, Peter Xu wrote: On Thu, Apr 20, 2017 at 04:55:24AM +, Liu, Yi L wrote: [...] In my previous RFC patchset of fault event reporting, I registered fault notifier when there is a VFIO group attached to VFIO container and used the address space to check whether vIOMMU is a

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Liu, Yi L
ct: Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT) > > On Thu, Apr 20, 2017 at 04:55:24AM +, Liu, Yi L wrote: > > [...] > > > > > In my previous RFC patchset of fault event reporting, I registered > > > > fault notifier when the

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Peter Xu
On Thu, Apr 20, 2017 at 04:55:24AM +, Liu, Yi L wrote: [...] > > > In my previous RFC patchset of fault event reporting, I registered > > > fault notifier when there is a VFIO group attached to VFIO container > > > and used the address space to check whether vIOMMU is added. The > > > address

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Liu, Yi L
-- > > >> From: Peter Xu [mailto:pet...@redhat.com] > > >> Sent: Tuesday, April 18, 2017 3:27 PM > > >> To: Liu, Yi L > > >> Cc: qemu-devel@nongnu.org; Lan, Tianyu ; Michael S > > >> . > > >> Tsirkin ; Jason Wang ; Mar

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Peter Xu
qemu-devel-bounces+yi.l.liu=intel@nongnu.org] > > On > > Behalf Of Peter Xu > > Sent: Monday, April 17, 2017 7:32 PM > > To: qemu-devel@nongnu.org > > Cc: Lan, Tianyu ; Michael S . Tsirkin > > ; > > Jason Wang ; pet...@redhat.com; Marcel Apfelbaum > &

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Peter Xu
3:27 PM > >> To: Liu, Yi L > >> Cc: qemu-devel@nongnu.org; Lan, Tianyu ; Michael S . > >> Tsirkin ; Jason Wang ; Marcel > >> Apfelbaum ; David Gibson > >> Subject: Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough > >>

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Lan Tianyu
el S . >> Tsirkin ; Jason Wang ; Marcel >> Apfelbaum ; David Gibson >> Subject: Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough >> (PT) >> >> On Tue, Apr 18, 2017 at 06:02:44AM +, Liu, Yi L wrote: >>>>> Hi Peter, >>>&g

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-19 Thread Liu, Yi L
2017 7:32 PM > To: qemu-devel@nongnu.org > Cc: Lan, Tianyu ; Michael S . Tsirkin ; > Jason Wang ; pet...@redhat.com; Marcel Apfelbaum > ; David Gibson > Subject: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT) > > Signed-off-by: Peter Xu > -

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-18 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Tuesday, April 18, 2017 3:27 PM > To: Liu, Yi L > Cc: qemu-devel@nongnu.org; Lan, Tianyu ; Michael S . > Tsirkin ; Jason Wang ; Marcel > Apfelbaum ; David Gibson > Subject: Re: [Q

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-18 Thread Peter Xu
On Tue, Apr 18, 2017 at 06:02:44AM +, Liu, Yi L wrote: > > > Hi Peter, > > > > > > Skip address space switching is a good idea to support Passthru mode. > > > However, without the address space, the vfio notifier would not be > > > registered, thus vIOMMU emulator has no way to connect to host.

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-17 Thread Liu, Yi L
> > Hi Peter, > > > > Skip address space switching is a good idea to support Passthru mode. > > However, without the address space, the vfio notifier would not be > > registered, thus vIOMMU emulator has no way to connect to host. It is > > no harm if there is only map/unmap notifier. But if we hav

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-17 Thread Peter Xu
On Tue, Apr 18, 2017 at 04:30:40AM +, Liu, Yi L wrote: [...] > > +static void vtd_switch_address_space(VTDAddressSpace *as) { > > +bool use_iommu; > > + > > +assert(as); > > + > > +use_iommu = as->iommu_state->dmar_enabled; > > +if (use_iommu) { > > +/* Further checks

Re: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-17 Thread Liu, Yi L
com; Marcel Apfelbaum > ; David Gibson > Subject: [Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT) > > Signed-off-by: Peter Xu > --- > hw/i386/intel_iommu.c | 109 > + > hw/i386/intel_iommu_internal.h | 1 + &g

[Qemu-devel] [PATCH v2 7/7] intel_iommu: support passthrough (PT)

2017-04-17 Thread Peter Xu
Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 109 + hw/i386/intel_iommu_internal.h | 1 + hw/i386/trace-events | 1 + hw/i386/x86-iommu.c| 1 + include/hw/i386/x86-iommu.h| 1 + 5 files changed, 93 insertion