[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay |
Date: |
Sun, 22 Jan 2017 17:09:58 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
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 mapping. If there is, then there's
> >problem - current replay didn't make sure the old mappings are cleared
> >before replaying the new one.
>
> I'm not quite sure this is needed. I thought the only thing we need to do is
> stop DMA of device during the moving? Or is there an example that will cause
> trouble?
I think this patch is essential.
Example:
- device D1 moved to domain A, domain A has no mapping
- map page P1 in domain A, so D1 will have a mapping of page P1
- create domain B with mapping P2
- move D1 from domain A to domain B
Here if we don't unmap existing pages in domain A (P1), after the
switch, we'll have D1 with both P1/P2 mapped, while domain B actually
only has P2. That's unaligned mapping, and it should be wrong.
If you (or anyone) think this is a bug as well for patch 18, I can
just squash both 19/20 into patch 18.
Thanks,
-- peterx
[Qemu-devel] [PATCH RFC v4 17/20] intel_iommu: allow dynamic switch of IOMMU region, Peter Xu, 2017/01/20
[Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay, Peter Xu, 2017/01/20
Re: [Qemu-devel] [PATCH RFC v4 19/20] intel_iommu: unmap existing pages before replay, Jason Wang, 2017/01/23
[Qemu-devel] [PATCH RFC v4 18/20] intel_iommu: enable vfio devices, Peter Xu, 2017/01/20