Re: BUG: Bad page state in process swapper pfn:00000

From: Geert Uytterhoeven
Date: Mon Jun 16 2014 - 04:35:54 EST


On Thu, Jun 12, 2014 at 4:51 AM, Laura Abbott <lauraa@xxxxxxxxxxxxxx> wrote:
> Great! Russell are you okay with taking the above as a fix or would you prefer
> I fixup drivers/of/fdt.c right now?
>
>
> Thanks,
> Laura
>
> ----8<----
> From 14bda557a108ad197e7c5f040f50ca024b45cc17 Mon Sep 17 00:00:00 2001
> From: Laura Abbott <lauraa@xxxxxxxxxxxxxx>
> Date: Wed, 11 Jun 2014 19:39:29 -0700
> Subject: [PATCH] arm: Bring back early_init_dt_add_memory_arch
>
> Commit 1c2f87c (ARM: 8025/1: Get rid of meminfo) removed
> early_init_dt_add_memory_arch in favor of using the common method.
> The common method does not currently check for memory outside of
> 32-bit bounds which may lead to memory being incorrectly added to
> the system. Bring back early_init_dt_add_memory_arch for now until
> the generic function can be fixed up.

There's another issue with the generic version: if the start address of the
memory block is not page-aligned, it will be rounded _down_ instead of up.

> Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Signed-off-by: Laura Abbott <lauraa@xxxxxxxxxxxxxx>

Tested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Still needed in v3.16-rc1.

> ---
> arch/arm/kernel/devtree.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> index e94a157..ea9ce92 100644
> --- a/arch/arm/kernel/devtree.c
> +++ b/arch/arm/kernel/devtree.c
> @@ -27,6 +27,10 @@
> #include <asm/mach/arch.h>
> #include <asm/mach-types.h>
>
> +void __init early_init_dt_add_memory_arch(u64 base, u64 size)
> +{
> + arm_add_memory(base, size);
> +}
>
> #ifdef CONFIG_SMP
> extern struct of_cpu_method __cpu_method_of_table[];

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/