diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-03 03:39:22 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-03 03:39:22 +0100 |
commit | 6aa293d8ff0939802a6c86cee6cd152c1b0a7a0d (patch) | |
tree | f07bcfb2e44bd8bc0a38c4b0fcc707b6ef1a7ab4 /arch/um/include/asm/pgtable.h | |
parent | Merge tag 's390-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390... (diff) | |
parent | um: Remove obsolete reenable_XX calls (diff) | |
download | linux-6aa293d8ff0939802a6c86cee6cd152c1b0a7a0d.tar.xz linux-6aa293d8ff0939802a6c86cee6cd152c1b0a7a0d.zip |
Merge branch 'for-linus-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull UML updates from Richard Weinberger:
- DISCARD support for our block device driver
- Many TLB flush optimizations
- Various smaller fixes
- And most important, Anton agreed to help me maintaining UML
* 'for-linus-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: Remove obsolete reenable_XX calls
um: writev needs <sys/uio.h>
Add Anton Ivanov to UML maintainers
um: remove redundant generic-y
um: Optimize Flush TLB for force/fork case
um: Avoid marking pages with "changed protection"
um: Skip TLB flushing where not needed
um: Optimize TLB operations v2
um: Remove unnecessary faulted check in uaccess.c
um: Add support for DISCARD in the UBD Driver
um: Remove unsafe printks from the io thread
um: Clean-up command processing in UML UBD driver
um: Switch to block-mq constants in the UML UBD driver
um: Make GCOV depend on !KCOV
um: Include sys/uio.h to have writev()
um: Add HAVE_DEBUG_BUGVERBOSE
um: Update maintainers file entry
Diffstat (limited to 'arch/um/include/asm/pgtable.h')
-rw-r--r-- | arch/um/include/asm/pgtable.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 7485398d0737..9c04562310b3 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -197,12 +197,17 @@ static inline pte_t pte_mkold(pte_t pte) static inline pte_t pte_wrprotect(pte_t pte) { - pte_clear_bits(pte, _PAGE_RW); + if (likely(pte_get_bits(pte, _PAGE_RW))) + pte_clear_bits(pte, _PAGE_RW); + else + return pte; return(pte_mknewprot(pte)); } static inline pte_t pte_mkread(pte_t pte) { + if (unlikely(pte_get_bits(pte, _PAGE_USER))) + return pte; pte_set_bits(pte, _PAGE_USER); return(pte_mknewprot(pte)); } @@ -221,6 +226,8 @@ static inline pte_t pte_mkyoung(pte_t pte) static inline pte_t pte_mkwrite(pte_t pte) { + if (unlikely(pte_get_bits(pte, _PAGE_RW))) + return pte; pte_set_bits(pte, _PAGE_RW); return(pte_mknewprot(pte)); } |