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


[Xen-devel] Re: A race condition in xenlinux exit_mmap

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: A race condition in xenlinux exit_mmap
From: hanzhu <hanzhu@xxxxxxxxxxx>
Date: Tue, 01 Aug 2006 18:24:17 +0800
Cc: "Li, Xin B" <xin.b.li@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 02 Aug 2006 01:53:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <f3e75409d0f6a013aea166268ef884e8@xxxxxxxxxxxx>
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>
Organization: sjtu
References: <0EBFB99D260C5B40AC33E0F807B1AD66BD2F0D@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <f3e75409d0f6a013aea166268ef884e8@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (Windows/20060719)
Hi, Keir,
Why not just reuse VM_FOREIGN(blktap uses this flag to represent foreign mapped vma) flag to unmap the foreign mapped pages before call arch_exit_mmap? This could be a simple alternative.

Best Regards,

Keir Fraser д:

On 1 Aug 2006, at 10:21, Li, Xin B wrote:

2 possible solutions are:
1) call arch_exit_mmap after unmap_vmas.
2) unmap foreign mapped pages before calling arch_exit_mmap, and then we
can do the normal cleanup jobs.

A longer term plan is to add an explicit flag to PTEs that are foreign mappings (and so are not refcounted). However, I think the easiest solution for now is to add a flag to mmu_context structure indicating whether this mm has ever had any foreign mappings (so you would set it in direct_remap_pfn_range()). If it has then we do not call mm_unpin() from _arch_exit_mmap() -- doing so is only an optimisation which we can simply not do for the very small number of mm's that have foreign mappings.

Do you mind creating a patch to do this? I can send you more details if you like.

 -- Keir

Xen-devel mailing list

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