WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab

To: benh@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction abstraction
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 18 Jun 2008 17:15:36 -0700
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>, kvm-devel <kvm-devel@xxxxxxxxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Virtualization Mailing List <virtualization@xxxxxxxxxxxxxx>, Hugh Dickins <hugh@xxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Delivery-date: Wed, 18 Jun 2008 17:16:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4859A149.9090004@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>
References: <b020e42384197b824320.1213615800@localhost> <1213831403.8011.24.camel@pasglop> <4859A149.9090004@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Jeremy Fitzhardinge wrote:
Benjamin Herrenschmidt wrote:
On Mon, 2008-06-16 at 04:30 -0700, Jeremy Fitzhardinge wrote:
The only current user of this interface is mprotect
Do you plan to use it with fork ultimately ?

Good point, I'd overlooked that. I guess that means using it in ptep_set_wrprotect().
Along the lines of:

--- a/include/asm-x86/pgtable.h Wed Jun 18 13:54:49 2008 -0700
+++ b/include/asm-x86/pgtable.h Wed Jun 18 17:03:39 2008 -0700
@@ -491,7 +491,11 @@
static inline void ptep_set_wrprotect(struct mm_struct *mm,
                                      unsigned long addr, pte_t *ptep)
{
-       clear_bit(_PAGE_BIT_RW, (unsigned long *)&ptep->pte);
+       pte_t pte = ptep_modify_prot_start(mm, addr, ptep);
+       
+       pte = pte_wrprotect(pte);
+
+       ptep_modify_prot_commit(mm, addr, ptep, pte);
        pte_update(mm, addr, ptep);
}


        J


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

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