Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-30 Thread Peter Xu
gt; > de...@nongnu.org' ; 'bd.a...@gmail.com' > > > > Subject: Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own > > replay() > > callback > > > > On Thu, Dec 29, 2016 at 10:23:21AM +, Liu, Yi L wrote: > > > > [...] &g

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-29 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Friday, December 30, 2016 11:44 AM > To: Liu, Yi L > Cc: Tian, Kevin ; Lan, Tianyu ; > 'qemu- > de...@nongnu.org' ; 'bd.a...@gmail.com' > > Subject: Re: [Qemu-devel]

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-29 Thread Peter Xu
On Thu, Dec 29, 2016 at 10:23:21AM +, Liu, Yi L wrote: [...] > > > > > > Hereby, I have a minor concern on this part. > > > The replay would be performed in vfio_listener_region_add() when device is > > > assigned. Since guest is just started, so there will be no valid context > > > entry fo

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-29 Thread Liu, Yi L
> -Original Message- > From: Peter Xu [mailto:pet...@redhat.com] > Sent: Thursday, December 29, 2016 5:56 PM > To: Liu, Yi L > Cc: Tian, Kevin ; Lan, Tianyu ; > 'qemu- > de...@nongnu.org' ; 'bd.a...@gmail.com' > > Subject: Re: [Qemu-devel]

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-29 Thread Peter Xu
On Thu, Dec 29, 2016 at 07:38:20AM +, Liu, Yi L wrote: [...] > > +static void vtd_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n) > > +{ > > +VTDAddressSpace *vtd_as = container_of(mr, VTDAddressSpace, iommu); > > +IntelIOMMUState *s = vtd_as->iommu_state; > > +uint8_t bus_n = pc

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-28 Thread Liu, Yi L
> The default replay() don't work for VT-d since vt-d will have a huge > default memory region which covers address range 0-(2^64-1). This will > normally bring a dead loop when guest starts. > > The solution is simple - we don't walk over all the regions. Instead, we > jump over the regions when

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-08 Thread Peter Xu
On Thu, Dec 08, 2016 at 11:01:53AM +0800, Lan Tianyu wrote: > On 2016年12月06日 18:36, Peter Xu wrote: > > +/** > > + * vtd_page_walk - walk specific IOVA range, and call the hook > > + * > > + * @ce: context entry to walk upon > > + * @start: IOVA address to start the walk > > + * @end: size of the I

Re: [Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-07 Thread Lan Tianyu
On 2016年12月06日 18:36, Peter Xu wrote: > +/** > + * vtd_page_walk - walk specific IOVA range, and call the hook > + * > + * @ce: context entry to walk upon > + * @start: IOVA address to start the walk > + * @end: size of the IOVA range to walk over *·@end:·IOVA·range·end·address·(start·<=·addr·<·e

[Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback

2016-12-06 Thread Peter Xu
The default replay() don't work for VT-d since vt-d will have a huge default memory region which covers address range 0-(2^64-1). This will normally bring a dead loop when guest starts. The solution is simple - we don't walk over all the regions. Instead, we jump over the regions when we found tha