diff options
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r-- | arch/powerpc/mm/pgtable_64.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index 3ef0ad2f9ca0..365e61ae5dbc 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
@@ -107,9 +107,18 @@ void __iomem * __ioremap_at(phys_addr_t pa, void *ea, unsigned long size, | |||
107 | { | 107 | { |
108 | unsigned long i; | 108 | unsigned long i; |
109 | 109 | ||
110 | /* Make sure we have the base flags */ | ||
110 | if ((flags & _PAGE_PRESENT) == 0) | 111 | if ((flags & _PAGE_PRESENT) == 0) |
111 | flags |= pgprot_val(PAGE_KERNEL); | 112 | flags |= pgprot_val(PAGE_KERNEL); |
112 | 113 | ||
114 | /* Non-cacheable page cannot be coherent */ | ||
115 | if (flags & _PAGE_NO_CACHE) | ||
116 | flags &= ~_PAGE_COHERENT; | ||
117 | |||
118 | /* We don't support the 4K PFN hack with ioremap */ | ||
119 | if (flags & _PAGE_4K_PFN) | ||
120 | return NULL; | ||
121 | |||
113 | WARN_ON(pa & ~PAGE_MASK); | 122 | WARN_ON(pa & ~PAGE_MASK); |
114 | WARN_ON(((unsigned long)ea) & ~PAGE_MASK); | 123 | WARN_ON(((unsigned long)ea) & ~PAGE_MASK); |
115 | WARN_ON(size & ~PAGE_MASK); | 124 | WARN_ON(size & ~PAGE_MASK); |
@@ -190,6 +199,13 @@ void __iomem * ioremap(phys_addr_t addr, unsigned long size) | |||
190 | void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size, | 199 | void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size, |
191 | unsigned long flags) | 200 | unsigned long flags) |
192 | { | 201 | { |
202 | /* writeable implies dirty for kernel addresses */ | ||
203 | if (flags & _PAGE_RW) | ||
204 | flags |= _PAGE_DIRTY; | ||
205 | |||
206 | /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */ | ||
207 | flags &= ~(_PAGE_USER | _PAGE_EXEC); | ||
208 | |||
193 | if (ppc_md.ioremap) | 209 | if (ppc_md.ioremap) |
194 | return ppc_md.ioremap(addr, size, flags); | 210 | return ppc_md.ioremap(addr, size, flags); |
195 | return __ioremap(addr, size, flags); | 211 | return __ioremap(addr, size, flags); |