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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeremy Fitzhardinge
Date: Wednesday, June 18, 2008 - 5:15 pm

Jeremy Fitzhardinge wrote:
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

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0 of 4] mm+paravirt+xen: add pte read-modify-write ..., Jeremy Fitzhardinge, (Mon Jun 16, 4:29 am)
[PATCH 1 of 4] mm: add a ptep_modify_prot transaction abst ..., Jeremy Fitzhardinge, (Mon Jun 16, 4:30 am)
[PATCH 2 of 4] paravirt: add hooks for ptep_modify_prot_st ..., Jeremy Fitzhardinge, (Mon Jun 16, 4:30 am)
[PATCH 3 of 4] xen: implement ptep_modify_prot_start/commit, Jeremy Fitzhardinge, (Mon Jun 16, 4:30 am)
[PATCH 4 of 4] xen: add mechanism to extend existing multi ..., Jeremy Fitzhardinge, (Mon Jun 16, 4:30 am)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Benjamin Herrenschmidt, (Wed Jun 18, 4:23 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Wed Jun 18, 4:59 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Wed Jun 18, 5:15 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Wed Jun 18, 5:37 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Benjamin Herrenschmidt, (Wed Jun 18, 5:39 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Wed Jun 18, 10:03 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Benjamin Herrenschmidt, (Thu Jun 19, 12:20 am)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Thu Jun 19, 10:57 am)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Fri Jun 20, 12:06 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Fri Jun 20, 1:05 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Fri Jun 20, 1:16 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ..., Jeremy Fitzhardinge, (Fri Jun 20, 1:22 pm)