mirror of https://gitee.com/openkylin/linux.git
powerpc/mm: Leave a gap between early allocated IO areas
Vmalloc system leaves a gap between allocated areas. It helps catching overflows. Do the same for IO areas which are allocated with early_ioremap_range() until slab_is_available(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/c433e358190fb5d47650463ea1ab755fc7b73e6e.1618828806.git.christophe.leroy@csgroup.eu
This commit is contained in:
parent
0e8554b5d7
commit
57307f1b6e
|
@ -70,10 +70,10 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, pgprot_t prot, void *call
|
||||||
*/
|
*/
|
||||||
pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", caller);
|
pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", caller);
|
||||||
|
|
||||||
err = early_ioremap_range(ioremap_bot - size, p, size, prot);
|
err = early_ioremap_range(ioremap_bot - size - PAGE_SIZE, p, size, prot);
|
||||||
if (err)
|
if (err)
|
||||||
return NULL;
|
return NULL;
|
||||||
ioremap_bot -= size;
|
ioremap_bot -= size + PAGE_SIZE;
|
||||||
|
|
||||||
return (void __iomem *)ioremap_bot + offset;
|
return (void __iomem *)ioremap_bot + offset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ void __iomem *__ioremap_caller(phys_addr_t addr, unsigned long size,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ret = (void __iomem *)ioremap_bot + offset;
|
ret = (void __iomem *)ioremap_bot + offset;
|
||||||
ioremap_bot += size;
|
ioremap_bot += size + PAGE_SIZE;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue