X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=mm%2Fcma.c;h=8e9ec13d31db2cce25384a4dc1a296e2a6fd2ca8;hb=6b101e2a3ce4d2a0312087598bd1ab4a1db2ac40;hp=fde706e1284fbc05edd04722fd8f0abf92d406bf;hpb=d82012695ef29e4e1c8153ccf43098ec8e50369e;p=cascardo%2Flinux.git diff --git a/mm/cma.c b/mm/cma.c index fde706e1284f..8e9ec13d31db 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -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); +#else + highmem_start = __pa(high_memory); +#endif pr_debug("%s(size %pa, base %pa, limit %pa alignment %pa)\n", __func__, &size, &base, &limit, &alignment);