diff options
author | Gerald Schaefer <gerald.schaefer@de.ibm.com> | 2013-01-21 16:48:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-03 18:27:01 -0600 |
commit | b85ddc2da7cc0827c0b3c3073b88730f5c1f20c9 (patch) | |
tree | 55859f865f0296d2eb130b8a7af40430b039d6b0 | |
parent | 2698f16a24e6ec48de944f00aef812f19247af60 (diff) | |
download | lwn-b85ddc2da7cc0827c0b3c3073b88730f5c1f20c9.tar.gz lwn-b85ddc2da7cc0827c0b3c3073b88730f5c1f20c9.zip |
s390/thp: implement pmdp_set_wrprotect()
commit be3286507dab888d4aad9f91fd6ff5202b24cd5b upstream.
On s390, an architecture-specific implementation of the function
pmdp_set_wrprotect() is missing and the generic version is currently
being used. The generic version does not flush the tlb as it would be
needed on s390 when modifying an active pmd, which can lead to subtle
tlb errors on s390 when using transparent hugepages.
This patch adds an s390-specific implementation of pmdp_set_wrprotect()
including the missing tlb flush.
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/s390/include/asm/pgtable.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 2d3b7cb26005..80d44ff438d2 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -1365,6 +1365,18 @@ static inline void pmdp_invalidate(struct vm_area_struct *vma, __pmd_idte(address, pmdp); } +#define __HAVE_ARCH_PMDP_SET_WRPROTECT +static inline void pmdp_set_wrprotect(struct mm_struct *mm, + unsigned long address, pmd_t *pmdp) +{ + pmd_t pmd = *pmdp; + + if (pmd_write(pmd)) { + __pmd_idte(address, pmdp); + set_pmd_at(mm, address, pmdp, pmd_wrprotect(pmd)); + } +} + static inline pmd_t mk_pmd_phys(unsigned long physpage, pgprot_t pgprot) { pmd_t __pmd; |