From: Stephen Rothwell Date: Mon, 29 Oct 2012 01:52:39 +0000 (+1100) Subject: Merge remote-tracking branch 'tip/auto-latest' X-Git-Tag: next-20121029~34 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9b46987361d2b7965c9f372bb725feed97e5f9ae;p=karo-tx-linux.git Merge remote-tracking branch 'tip/auto-latest' --- 9b46987361d2b7965c9f372bb725feed97e5f9ae 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)