diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-06-16 13:16:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-16 16:16:16 -0400 |
commit | 8dab5241d06bfc9ee141ea78c56cde5070d7460d (patch) | |
tree | dd9dc3c64c17862b169f4cbe5fd4a108d960c920 /include/asm-powerpc | |
parent | 679ce0ace6b1a07043bc3b405a34ddccad808886 (diff) |
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>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/pgtable-ppc32.h | 12 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-ppc64.h | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h index c863bdb2889c..7fb730c62f83 100644 --- a/include/asm-powerpc/pgtable-ppc32.h +++ b/include/asm-powerpc/pgtable-ppc32.h | |||
@@ -673,10 +673,14 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) | |||
673 | } | 673 | } |
674 | 674 | ||
675 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | 675 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ |
676 | do { \ | 676 | ({ \ |
677 | __ptep_set_access_flags(__ptep, __entry, __dirty); \ | 677 | int __changed = !pte_same(*(__ptep), __entry); \ |
678 | flush_tlb_page_nohash(__vma, __address); \ | 678 | if (__changed) { \ |
679 | } while(0) | 679 | __ptep_set_access_flags(__ptep, __entry, __dirty); \ |
680 | flush_tlb_page_nohash(__vma, __address); \ | ||
681 | } \ | ||
682 | __changed; \ | ||
683 | }) | ||
680 | 684 | ||
681 | /* | 685 | /* |
682 | * Macro to mark a page protection value as "uncacheable". | 686 | * Macro to mark a page protection value as "uncacheable". |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index 704c4e669fe0..3cfd98f44bfe 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
@@ -413,10 +413,14 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) | |||
413 | :"cc"); | 413 | :"cc"); |
414 | } | 414 | } |
415 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | 415 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ |
416 | do { \ | 416 | ({ \ |
417 | __ptep_set_access_flags(__ptep, __entry, __dirty); \ | 417 | int __changed = !pte_same(*(__ptep), __entry); \ |
418 | flush_tlb_page_nohash(__vma, __address); \ | 418 | if (__changed) { \ |
419 | } while(0) | 419 | __ptep_set_access_flags(__ptep, __entry, __dirty); \ |
420 | flush_tlb_page_nohash(__vma, __address); \ | ||
421 | } \ | ||
422 | __changed; \ | ||
423 | }) | ||
420 | 424 | ||
421 | /* | 425 | /* |
422 | * Macro to mark a page protection value as "uncacheable". | 426 | * Macro to mark a page protection value as "uncacheable". |