summaryrefslogtreecommitdiff
path: root/mm/early_ioremap.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2015-07-17 07:51:33 +0300
committerDavid Vrabel <david.vrabel@citrix.com>2015-08-20 14:24:22 +0300
commit2592dbbbf4c67501c2bd2dcf89c2b8924d592a9f (patch)
treede5834b2dfbd829951b8dc93c8ecd98b1d3b7de2 /mm/early_ioremap.c
parent4b9c15377f96e241be347fd3bbeeff74fbad0b44 (diff)
downloadlinux-2592dbbbf4c67501c2bd2dcf89c2b8924d592a9f.tar.xz
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)
return (__force void *)__early_ioremap(phys_addr, size,
FIXMAP_PAGE_NORMAL);
}
+#ifdef FIXMAP_PAGE_RO
+void __init *
+early_memremap_ro(resource_size_t phys_addr, unsigned long size)
+{
+ return (__force void *)__early_ioremap(phys_addr, size, FIXMAP_PAGE_RO);
+}
+#endif
#else /* CONFIG_MMU */
void __init __iomem *
@@ -231,6 +238,11 @@ early_memremap(resource_size_t phys_addr, unsigned long size)
{
return (void *)phys_addr;
}
+void __init *
+early_memremap_ro(resource_size_t phys_addr, unsigned long size)
+{
+ return (void *)phys_addr;
+}
void __init early_iounmap(void __iomem *addr, unsigned long size)
{