qemu-devel
[Top][All Lists]
Advanced

[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: Tue, 24 Jan 2017 15:31:53 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

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_replay(MemoryRegion *mr, 
> >IOMMUNotifier *n)
> >      if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) == 0) {
> >          /*
> >-         * Scanned a valid context entry, walk over the pages and
> >-         * notify when needed.
> >+         * Scanned a valid context entry, we first make sure to remove
> >+         * all existing mappings in old domain, by sending UNMAP to
> >+         * all the notifiers. Then, we walk over the pages and notify
> >+         * with existing mapped new entries in the new domain.
> >           */
> 
> A question is what if the context cache was invalidated but the device were
> not moved to a new domain. Then the code here does not do anything I
> believe?

Yes, it'll unmap all the stuffs and remap them all. I think that's my
intention, and can we really avoid this?

> I think we should move vtd_address_space_unmap() in the context
> entry invalidation processing.

IMHO we need this "whole umap" thing not only for context entry
invalidation, but all the places that need this replay, no? For
example, when we receive domain flush.

Thanks,

-- peterx



reply via email to

[Prev in Thread] Current Thread [Next in Thread]