Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-24 Thread Peter Xu
On Wed, Jan 25, 2017 at 11:11:30AM +0800, Jason Wang wrote: > > > On 2017年01月24日 15:31, Peter Xu wrote: > >On Mon, Jan 23, 2017 at 06:40:12PM +0800, Jason Wang wrote: > >>On 2017年01月20日 21:08, Peter Xu wrote: > >>> static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private) > >>> { > >>>

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-24 Thread Jason Wang
On 2017年01月24日 15:31, Peter Xu wrote: On Mon, Jan 23, 2017 at 06:40:12PM +0800, Jason Wang wrote: On 2017年01月20日 21:08, Peter Xu wrote: static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private) { memory_region_notify_one((IOMMUNotifier *)private, entry); @@ -2711,13 +2768,16 @

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-23 Thread Peter Xu
On Mon, Jan 23, 2017 at 06:40:12PM +0800, Jason Wang wrote: > > > On 2017年01月20日 21:08, Peter Xu wrote: > > static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private) > > { > > memory_region_notify_one((IOMMUNotifier *)private, entry); > >@@ -2711,13 +2768,16 @@ static void vtd_iommu_

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-23 Thread Jason Wang
On 2017年01月20日 21:08, Peter Xu wrote: static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private) { memory_region_notify_one((IOMMUNotifier *)private, entry); @@ -2711,13 +2768,16 @@ static void vtd_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n) if (vtd_dev_to_context_

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-23 Thread Jason Wang
On 2017年01月23日 15:30, Peter Xu wrote: On Mon, Jan 23, 2017 at 09:57:23AM +0800, Jason Wang wrote: On 2017年01月22日 17:09, Peter Xu wrote: On Sun, Jan 22, 2017 at 04:13:32PM +0800, Jason Wang wrote: On 2017年01月20日 21:08, Peter Xu wrote: Previous replay works for domain switch only if the orig

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-22 Thread Peter Xu
On Mon, Jan 23, 2017 at 09:57:23AM +0800, Jason Wang wrote: > > > On 2017年01月22日 17:09, Peter Xu wrote: > >On Sun, Jan 22, 2017 at 04:13:32PM +0800, Jason Wang wrote: > >> > >>On 2017年01月20日 21:08, Peter Xu wrote: > >>>Previous replay works for domain switch only if the original domain does > >>>

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-22 Thread Jason Wang
On 2017年01月22日 17:09, Peter Xu wrote: On Sun, Jan 22, 2017 at 04:13:32PM +0800, Jason Wang wrote: On 2017年01月20日 21:08, Peter Xu wrote: Previous replay works for domain switch only if the original domain does not have mapped pages. For example, if we switch domain from A to B, it will only w

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-22 Thread Peter Xu
On Sun, Jan 22, 2017 at 04:13:32PM +0800, Jason Wang wrote: > > > On 2017年01月20日 21:08, Peter Xu wrote: > >Previous replay works for domain switch only if the original domain does > >not have mapped pages. For example, if we switch domain from A to B, it > >will only work if A has no existing map

Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-22 Thread Jason Wang
On 2017年01月20日 21:08, Peter Xu wrote: Previous replay works for domain switch only if the original domain does not have mapped pages. For example, if we switch domain from A to B, it will only work if A has no existing mapping. If there is, then there's problem - current replay didn't make sure

[Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay

2017-01-20 Thread Peter Xu
Previous replay works for domain switch only if the original domain does not have mapped pages. For example, if we switch domain from A to B, it will only work if A has no existing mapping. If there is, then there's problem - current replay didn't make sure the old mappings are cleared before repla