From 531deb70f383aa32f24121326d5cdf79f2558e1e Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Wed, 13 Oct 2004 07:27:01 -0700 Subject: [PATCH] ptep_establish smp race x86 PAE >4G This avoid userspace mm corruption during COWs with threads (i.e. malloc;fork;clone) on x86 PAE with >4G of ram Signed-Off-By: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/pgtable.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/asm-generic/pgtable.h') diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 29573197c3ee..cf791b073e76 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -13,11 +13,19 @@ * Note: the old pte is known to not be writable, so we don't need to * worry about dirty bits etc getting lost. */ +#ifndef __HAVE_ARCH_SET_PTE_ATOMIC #define ptep_establish(__vma, __address, __ptep, __entry) \ do { \ set_pte(__ptep, __entry); \ flush_tlb_page(__vma, __address); \ } while (0) +#else /* __HAVE_ARCH_SET_PTE_ATOMIC */ +#define ptep_establish(__vma, __address, __ptep, __entry) \ +do { \ + set_pte_atomic(__ptep, __entry); \ + flush_tlb_page(__vma, __address); \ +} while (0) +#endif /* __HAVE_ARCH_SET_PTE_ATOMIC */ #endif #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS -- cgit v1.2.3