aboutsummaryrefslogtreecommitdiffstats
path: root/mm/early_ioremap.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2015-07-17 00:51:33 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2015-08-20 07:24:22 -0400
commit2592dbbbf4c67501c2bd2dcf89c2b8924d592a9f (patch)
treede5834b2dfbd829951b8dc93c8ecd98b1d3b7de2 /mm/early_ioremap.c
parent4b9c15377f96e241be347fd3bbeeff74fbad0b44 (diff)
mm: provide early_memremap_ro to establish read-only mapping
During early boot as Xen pv domain the kernel needs to map some page tables supplied by the hypervisor read only. This is needed to be able to relocate some data structures conflicting with the physical memory map especially on systems with huge RAM (above 512GB). Provide the function early_memremap_ro() to provide this read only mapping. Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'mm/early_ioremap.c')
-rw-r--r--mm/early_ioremap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
index e10ccd299d66..0cfadafb3fb0 100644
--- a/mm/early_ioremap.c
+++ b/mm/early_ioremap.c
@@ -217,6 +217,13 @@ early_memremap(resource_size_t phys_addr, unsigned long size)
217 return (__force void *)__early_ioremap(phys_addr, size, 217 return (__force void *)__early_ioremap(phys_addr, size,
218 FIXMAP_PAGE_NORMAL); 218 FIXMAP_PAGE_NORMAL);
219} 219}
220#ifdef FIXMAP_PAGE_RO
221void __init *
222early_memremap_ro(resource_size_t phys_addr, unsigned long size)
223{
224 return (__force void *)__early_ioremap(phys_addr, size, FIXMAP_PAGE_RO);
225}
226#endif
220#else /* CONFIG_MMU */ 227#else /* CONFIG_MMU */
221 228
222void __init __iomem * 229void __init __iomem *
@@ -231,6 +238,11 @@ early_memremap(resource_size_t phys_addr, unsigned long size)
231{ 238{
232 return (void *)phys_addr; 239 return (void *)phys_addr;
233} 240}
241void __init *
242early_memremap_ro(resource_size_t phys_addr, unsigned long size)
243{
244 return (void *)phys_addr;
245}
234 246
235void __init early_iounmap(void __iomem *addr, unsigned long size) 247void __init early_iounmap(void __iomem *addr, unsigned long size)
236{ 248{