diff options
Diffstat (limited to 'include/asm-x86_64/pgtable.h')
-rw-r--r-- | include/asm-x86_64/pgtable.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 08b9831f2e14..0a71e0b9a619 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -395,12 +395,14 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
395 | * bit at the same time. */ | 395 | * bit at the same time. */ |
396 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 396 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
397 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | 397 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ |
398 | do { \ | 398 | ({ \ |
399 | if (__dirty) { \ | 399 | int __changed = !pte_same(*(__ptep), __entry); \ |
400 | set_pte(__ptep, __entry); \ | 400 | if (__changed && __dirty) { \ |
401 | flush_tlb_page(__vma, __address); \ | 401 | set_pte(__ptep, __entry); \ |
402 | } \ | 402 | flush_tlb_page(__vma, __address); \ |
403 | } while (0) | 403 | } \ |
404 | __changed; \ | ||
405 | }) | ||
404 | 406 | ||
405 | /* Encode and de-code a swap entry */ | 407 | /* Encode and de-code a swap entry */ |
406 | #define __swp_type(x) (((x).val >> 1) & 0x3f) | 408 | #define __swp_type(x) (((x).val >> 1) & 0x3f) |