Thread (33 messages) 33 messages, 6 authors, 2008-06-21

Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction abstraction

From: Jeremy Fitzhardinge <hidden>
Date: 2008-06-19 00:16:28
Also in: lkml, xen-devel

Jeremy Fitzhardinge wrote:
Benjamin Herrenschmidt wrote:
  
quoted
On Mon, 2008-06-16 at 04:30 -0700, Jeremy Fitzhardinge wrote:
  
    
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help