Commit 6b101e2a authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm/CMA: fix boot regression due to physical address of high_memory

high_memory isn't direct mapped memory so retrieving it's physical address
isn't appropriate.  But, it would be useful to check physical address of
highmem boundary so it's justfiable to get physical address from it.  In
x86, there is a validation check if CONFIG_DEBUG_VIRTUAL and it triggers
following boot failure reported by Ingo.

  BUG: Int 6: CR2 00f06f53
  Call Trace:

To fix boot regression, this patch implements workaround to avoid
validation check in x86 when retrieving physical address of high_memory.
__pa_nodebug() used by this patch is implemented only in x86 so there is
no choice but to use dirty #ifdef.

[ tweak comment]
Signed-off-by: default avatarJoonsoo Kim <>
Reported-by: default avatarIngo Molnar <>
Tested-by: default avatarIngo Molnar <>
Cc: Marek Szyprowski <>
Cc: Russell King <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent d8201269
......@@ -215,9 +215,21 @@ int __init cma_declare_contiguous(phys_addr_t base,
bool fixed, struct cma **res_cma)
phys_addr_t memblock_end = memblock_end_of_DRAM();
phys_addr_t highmem_start = __pa(high_memory);
phys_addr_t highmem_start;
int ret = 0;
#ifdef CONFIG_X86
* high_memory isn't direct mapped memory so retrieving its physical
* address isn't appropriate. But it would be useful to check the
* physical address of the highmem boundary so it's justfiable to get
* the physical address from it. On x86 there is a validation check for
* this case, so the following workaround is needed to avoid it.
highmem_start = __pa_nodebug(high_memory);
highmem_start = __pa(high_memory);
pr_debug("%s(size %pa, base %pa, limit %pa alignment %pa)\n",
__func__, &size, &base, &limit, &alignment);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment