Rework ptep_set_access_flags and fix sun4c
Some changes done a while ago to avoid pounding on ptep_set_access_flags and update_mmu_cache in some race situations break sun4c which requires update_mmu_cache() to always be called on minor faults. This patch reworks ptep_set_access_flags() semantics, implementations and callers so that it's now responsible for returning whether an update is necessary or not (basically whether the PTE actually changed). This allow fixing the sparc implementation to always return 1 on sun4c. [akpm@linux-foundation.org: fixes, cleanups] Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Hugh Dickins <hugh@veritas.com> Cc: David Miller <davem@davemloft.net> Cc: Mark Fortescue <mark@mtfhpc.demon.co.uk> Acked-by: William Lee Irwin III <wli@holomorphy.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
679ce0ace6
commit
8dab5241d0
@@ -533,16 +533,23 @@ extern void lazy_mmu_prot_update (pte_t pte);
|
||||
* daccess_bit in ivt.S).
|
||||
*/
|
||||
#ifdef CONFIG_SMP
|
||||
# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
|
||||
do { \
|
||||
if (__safely_writable) { \
|
||||
set_pte(__ptep, __entry); \
|
||||
flush_tlb_page(__vma, __addr); \
|
||||
} \
|
||||
} while (0)
|
||||
# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
|
||||
({ \
|
||||
int __changed = !pte_same(*(__ptep), __entry); \
|
||||
if (__changed && __safely_writable) { \
|
||||
set_pte(__ptep, __entry); \
|
||||
flush_tlb_page(__vma, __addr); \
|
||||
} \
|
||||
__changed; \
|
||||
})
|
||||
#else
|
||||
# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
|
||||
ptep_establish(__vma, __addr, __ptep, __entry)
|
||||
# define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \
|
||||
({ \
|
||||
int __changed = !pte_same(*(__ptep), __entry); \
|
||||
if (__changed) \
|
||||
ptep_establish(__vma, __addr, __ptep, __entry); \
|
||||
__changed; \
|
||||
})
|
||||
#endif
|
||||
|
||||
# ifdef CONFIG_VIRTUAL_MEM_MAP
|
||||
|
Reference in New Issue
Block a user