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: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] Vanilla Linux and has_foreign_mapping
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 25 Apr 2008 07:01:39 +0100
Cc: Mark McLoughlin <markmc@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Andrea Arcangeli <andrea@xxxxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Michael Abd-El-Malek <mabdelmalek@xxxxxxx>, Christoph Lameter <clameter@xxxxxxx>
Delivery-date: Thu, 24 Apr 2008 23:01:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <48112345.5000503@xxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcimmdOUEd6vMRKNEd2PpQAWy6hiGQ==
Thread-topic: [Xen-devel] Vanilla Linux and has_foreign_mapping
User-agent: Microsoft-Entourage/
On 25/4/08 01:18, "Jeremy Fitzhardinge" <jeremy@xxxxxxxx> wrote:

> So the issue is that a pte page containing a _PAGE_IO pte must remain
> pinned while it contains that mapping?  Would shooting down the mapping
> allow it to be unpinned, or does that need to be deferred until some
> later point (if so, when?)?

If you have _PAGE_IO then only unpinning of ptes containing grant-table
mappings must not be deferred. 'Ordinary' foreign mappings, of the sort that
dom0 can create because it is privileged, do not have this constraint. This
is because you can tell they are foreign, and hence avoid page refcounting,
simply because the pte contains _PAGE_IO. Without _PAGE_IO we relied on
checking whether a machine->pseudophys->machine double lookup took us from
the machine address in the pte back to the same machine address. If not, we
knew the page was not ours. This doesn't work reliably if the pte page is
not pinned because in that case the mapped page can be freed from the
foreign domain and be reallocated into the local domain: in which case the
M->P->M check could succeed! The _PAGE_IO check is more robust.

 -- Keir

Xen-devel mailing list