[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 02/17] vfio: introduce vfio_get_vaddr()
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v7 02/17] vfio: introduce vfio_get_vaddr() |
Date: |
Fri, 10 Feb 2017 13:50:50 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Fri, Feb 10, 2017 at 12:12:22PM +1100, David Gibson wrote:
> On Tue, Feb 07, 2017 at 04:28:04PM +0800, Peter Xu wrote:
> > A cleanup for vfio_iommu_map_notify(). Now we will fetch vaddr even if
> > the operation is unmap, but it won't hurt much.
> >
> > One thing to mention is that we need the RCU read lock to protect the
> > whole translation and map/unmap procedure.
> >
> > Acked-by: Alex Williamson <address@hidden>
> > Reviewed-by: David Gibson <address@hidden>
> > Signed-off-by: Peter Xu <address@hidden>
>
> So, I know I reviewed this already, but looking again I'm confused.
>
> I'm not sure how the original code ever worked: if this is an unmap
> (perm == IOMMU_NONE), then I wouldn't even expect
> iotlb->translated_addr to have a valid value, but we're passing it to
> address_space_translate() and failing if it it doesn't give us
> sensible results.
Hmm, right.
Looks like it is just because we have accidentally inited
iotlb->translated_addr in all the callers of
memory_region_notify_iommu (one is put_tce_emu(), the other one is
rpcit_service_call()). If so, patch 3 (maybe, along with this one)
would be more essential imho to make sure we don't have such an
assumption.
Thanks,
-- peterx
- [Qemu-devel] [PATCH v7 00/17] VT-d: vfio enablement and misc enhances, Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 01/17] vfio: trace map/unmap for notify as well, Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 02/17] vfio: introduce vfio_get_vaddr(), Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 03/17] vfio: allow to notify unmap for very large region, Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 05/17] intel_iommu: simplify irq region translation, Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 04/17] intel_iommu: add "caching-mode" option, Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 06/17] intel_iommu: renaming gpa to iova where proper, Peter Xu, 2017/02/07
- [Qemu-devel] [PATCH v7 07/17] intel_iommu: convert dbg macros to traces for inv, Peter Xu, 2017/02/07