From: Gerald Schaefer Date: Thu, 18 Oct 2012 16:26:42 +0000 (+0200) Subject: sched, numa, mm, s390/thp: Implement pmd_pgprot() for s390 X-Git-Tag: next-20121029~34^2^2~27 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a5a608d83e0e680f44e8d25e860e5d57633b5bcb;p=karo-tx-linux.git sched, numa, mm, s390/thp: Implement pmd_pgprot() for s390 This patch adds an implementation of pmd_pgprot() for s390, in preparation to future THP changes. Reported-by: Stephen Rothwell Signed-off-by: Gerald Schaefer Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Peter Zijlstra Cc: Ralf Baechle Signed-off-by: Ingo Molnar --- diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index dd647c919a66..098fc5a6bd52 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -1240,6 +1240,19 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, *pmdp = entry; } +static inline pgprot_t pmd_pgprot(pmd_t pmd) +{ + pgprot_t prot = PAGE_RW; + + if (pmd_val(pmd) & _SEGMENT_ENTRY_RO) { + if (pmd_val(pmd) & _SEGMENT_ENTRY_INV) + prot = PAGE_NONE; + else + prot = PAGE_RO; + } + return prot; +} + static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot) { unsigned long pgprot_pmd = 0;