From: Stephen Rothwell Date: Tue, 30 Oct 2012 02:32:08 +0000 (+1100) Subject: Merge remote-tracking branch 'tip/auto-latest' X-Git-Tag: next-20121030~36 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eda3df6a5b1099c2a5028b423df66e70986a8d30;p=karo-tx-linux.git Merge remote-tracking branch 'tip/auto-latest' --- eda3df6a5b1099c2a5028b423df66e70986a8d30 diff --cc arch/s390/include/asm/pgtable.h index 0eefb9e192d1,b820ff1db35e..325a5d6ceabf --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@@ -1258,17 -1240,31 +1258,30 @@@ static inline void set_pmd_at(struct mm *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; - - if (pgprot_val(pgprot) & _PAGE_INVALID) { - if (pgprot_val(pgprot) & _PAGE_SWT) - pgprot_pmd |= _HPAGE_TYPE_NONE; - pgprot_pmd |= _SEGMENT_ENTRY_INV; - } - if (pgprot_val(pgprot) & _PAGE_RO) - pgprot_pmd |= _SEGMENT_ENTRY_RO; - return pgprot_pmd; + /* + * pgprot is PAGE_NONE, PAGE_RO, or PAGE_RW (see __Pxxx / __Sxxx) + * Convert to segment table entry format. + */ + if (pgprot_val(pgprot) == pgprot_val(PAGE_NONE)) + return pgprot_val(SEGMENT_NONE); + if (pgprot_val(pgprot) == pgprot_val(PAGE_RO)) + return pgprot_val(SEGMENT_RO); + return pgprot_val(SEGMENT_RW); } static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)