This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] Vanilla Linux and has_foreign_mapping

To: Andrea Arcangeli <andrea@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Vanilla Linux and has_foreign_mapping
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Fri, 25 Apr 2008 17:14:03 -0700
Cc: Mark McLoughlin <markmc@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Michael Abd-El-Malek <mabdelmalek@xxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Christoph Lameter <clameter@xxxxxxx>
Delivery-date: Fri, 25 Apr 2008 17:14:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080425172416.GC23300@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C4329BC3.16E37%keir.fraser@xxxxxxxxxxxxx> <48112345.5000503@xxxxxxxx> <481210C0.6070109@xxxxxxx> <20080425172416.GC23300@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (X11/20080418)
Andrea Arcangeli wrote:
Hello everyone,

On Fri, Apr 25, 2008 at 01:11:28PM -0400, Michael Abd-El-Malek wrote:
-       /* mm's last user has gone, and its about to be pulled down */
-       arch_exit_mmap(mm);
        tlb = tlb_gather_mmu(mm, 1);
        /* Don't update_hiwater_rss(mm) here, do_exit already did */
        /* Use -1 here to ensure all VMAs in the mm are unmapped */
        end = unmap_vmas(&tlb, vma, 0, -1, &nr_accounted, NULL);
+       /* mm's last user has gone, and its about to be pulled down */
+       arch_exit_mmap(mm);

If that's what you need I doubt mmu notifiers can help. mmu notifiers
allows to keep secondary mmu mappings (like vmx/svm/npt/ept sptes) in
total synchrony with the primary mmu mappings established by the linux
VM. All secondary mmu mappings must be zapped and the secondary mmu
must be freezed before the pages are freed, hence the last mmu
notifier call is ->release and it's done _before_ the above

For Xen, arch_exit_mmap() needs to be done before unmap_vmas since the whole point is to switch to init_mm before tearing down the pagetable to avoid lots of hypercalls. The trouble is that mappings of foreign pages need to be dealt with specially because Xen requires that they be unmapped with a special mechanism.

What I was wondering if, rather than getting a callback, we could call into the mmu notifier machinery to get a list of mapped foreign pages and their corresponding pte pointers so that they can be "manually" unmapped early in Xen's arch_exit_mmap().

On the other hand, I think we can just hang a shadow page off the pte page's struct page to store all the extra metadata we need...


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>