[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4859A528.1010107@goop.org>
Date: Wed, 18 Jun 2008 17:15:36 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: benh@...nel.crashing.org
CC: xen-devel <xen-devel@...ts.xensource.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
kvm-devel <kvm-devel@...ts.sourceforge.net>, x86@...nel.org,
LKML <linux-kernel@...r.kernel.org>,
Virtualization Mailing List <virtualization@...ts.osdl.org>,
Hugh Dickins <hugh@...itas.com>, Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction abstraction
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists