Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1940584imu; Wed, 12 Dec 2018 07:00:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFgLt9yG4VBuK2B4N/YFcy51B4rht1xzEnemYMfDF74d8euIjJAoQvwdss/O4h582WY1d/ X-Received: by 2002:a62:1709:: with SMTP id 9mr20210190pfx.249.1544626810359; Wed, 12 Dec 2018 07:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544626810; cv=none; d=google.com; s=arc-20160816; b=jy+sKcU8P46qAoFkc9aHnfCG6S+bL1iZvri4vAkbEnpPU7UqBfiGNjd65rjRdsrL70 S77PLuSl2NqgMzyBLW4kKoiOD1rXegtD8IlLMwNN3X7qNGURf6iuWh8TnwG3IaUgLCKi aRA2U1V737y3RO69wXKGKVHtMgJMSRlDbYUycSK7bUyRpn31G8L7YA+9PlpMFc44CuVe KGo6gSPFij3owy84wJBrWf6xMoNNIs2xjrzE4PWOCwzpaXMf7Pud5HMXTTrNeKnyTHkZ T3DoLHRHObCLkRyCkF6L7cSOlfmvr9jU76viWp7KZmEzd+wUpvA3jZsZ3bPwY80j3+tc Qbxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=0m2cSOPHqWCI1RzjYj1hl2ykcnYNNtnj5A2KYjWBg8U=; b=vPxM4vgkGOxHGiHIlhks0PY4R8z1pV2nWqDX4/WvXqBkH+WSAUHjzbESOwgz/KKUTX vv7pxivDQZi1F/sJS1VB0gqNYW1cOxyLjZf9i9tqChb7kqzbAN+akofQPrmpCDRkHoyo Q5cy4fBdF9ybjxd/SD+1v609/9PQIK4TT6YuB7YfeLeplAMRrw8hVfbDNGA2tMdrf7OR DxG7qMLNjHDtk6gEFWvxw29Aw2YCs9hcsoQ92BvFiRiyNT0ecmrhD4Vsmy1iNvXJgZBp KpcAJh/sR0GfPV9NVB6TKO3qttx0rzpdRR/HtudsrA7eq7csFhSHtjybbIGq2iE1+s8r n25g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k142si16549363pfd.174.2018.12.12.06.59.52; Wed, 12 Dec 2018 07:00:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727290AbeLLO64 (ORCPT + 99 others); Wed, 12 Dec 2018 09:58:56 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:36535 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726468AbeLLO64 (ORCPT ); Wed, 12 Dec 2018 09:58:56 -0500 Received: by mail-vs1-f67.google.com with SMTP id v205so11232094vsc.3 for ; Wed, 12 Dec 2018 06:58:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0m2cSOPHqWCI1RzjYj1hl2ykcnYNNtnj5A2KYjWBg8U=; b=SEeG7idUr8el50bBAe3ycR473cG2dA9/bDhZq7/6Yt0hIQKQNaYv6ulIXtcEHHsbUF bVl7IPyROuJsMjJruiKRU0Otu9f12cOnF41chNCkUPkvNt1VE/dW6wfyx5eje/3soNOi 4ocJNVWv5wGrxXHMDKIsJbhs74BvQM1pGCpCt2noV+5G+IznYirH74WYtHvZsyEyo+cD ciyV+EBEXNv0Jr8o+wqtdV5Z1lfiYJOMvd9bPniS74P2Ez0WPxp0OmN/70KyVJchEE2u lU+3q8nqmksqQqGD17C2p+NMr7n9thd+AD5b1pvmrB2ZDB6V7pflnRs/M1jELq4ky/Rk uLTw== X-Gm-Message-State: AA+aEWbyjC7woYtK/t9doMLalVEcjq6TTP8RlIfyIKt00+TqAuUDcIBJ WOO8Mt6vVn31Xk6ZWYUSTmryaQU4hE0T0qNSHhk= X-Received: by 2002:a67:f43:: with SMTP id 64mr9522253vsp.166.1544626734755; Wed, 12 Dec 2018 06:58:54 -0800 (PST) MIME-Version: 1.0 References: <20181207165011.31497-1-geert@linux-m68k.org> In-Reply-To: <20181207165011.31497-1-geert@linux-m68k.org> From: Geert Uytterhoeven Date: Wed, 12 Dec 2018 15:58:42 +0100 Message-ID: Subject: Re: [PATCH v3] m68k: Fix memblock-related crashes To: Andreas Schwab , rppt@linux.ibm.com, Michael Schmitz Cc: Sam Creasey , Greg Ungerer , linux-m68k , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andreas, On Fri, Dec 7, 2018 at 5:50 PM Geert Uytterhoeven wrote: > When running the kernel in Fast RAM on Atari: > > Ignoring memory chunk at 0x0:0xe00000 before the first chunk > ... > Unable to handle kernel NULL pointer dereference at virtual address (ptrval) > Oops: 00000000 > Modules linked in: > PC: [<0069dbac>] free_all_bootmem+0x12c/0x186 > SR: 2714 SP: (ptrval) a2: 005e3314 > d0: 00000000 d1: 0000000a d2: 00000e00 d3: 00000000 > d4: 005e1fc0 d5: 0000001a a0: 01000000 a1: 00000000 > Process swapper (pid: 0, task=(ptrval)) > Frame format=7 eff addr=00000736 ssw=0505 faddr=00000736 > wb 1 stat/addr/data: 0000 00000000 00000000 > wb 2 stat/addr/data: 0000 00000000 00000000 > wb 3 stat/addr/data: 0000 00000736 00000000 > push data: 00000000 00000000 00000000 00000000 > Stack from 005e1f84: > 00000000 0000000a 027d3260 006b5006 00000000 00000000 00000000 00000000 > 0004f062 0003a220 0069e272 005e1ff8 0000054c 00000000 00e00000 00000000 > 00000001 00693cd8 027d3260 0004f062 0003a220 00691be6 00000000 00000000 > 00000000 00000000 00000000 00000000 006b5006 00000000 00690872 > Call Trace: [<0004f062>] printk+0x0/0x18 > [<0003a220>] parse_args+0x0/0x2d4 > [<0069e272>] memblock_virt_alloc_try_nid+0x0/0xa4 > [<00693cd8>] mem_init+0xa/0x5c > [<0004f062>] printk+0x0/0x18 > [<0003a220>] parse_args+0x0/0x2d4 > [<00691be6>] start_kernel+0x1ca/0x462 > [<00690872>] _sinittext+0x872/0x11f8 > Code: 7a1a eaae 2270 6db0 0061 ef14 2f01 2f03 <96a9> 0736 2203 e589 d681 e78b d6a9 0732 2f03 2f40 0034 4eb9 0069 b8d0 260e 4fef > Disabling lock debugging due to kernel taint > Kernel panic - not syncing: Attempted to kill the idle task! > > As the kernel must run in the memory chunk with the lowest address, > ST-RAM is ignored, and removed from the m68k_memory[] array. > However, it is not removed from memblock, causing a crash later. > > More investigation shows that there are 3 places where memory chunks are > ignored, all after the calls to memblock_add() in m68k_parse_bootinfo(), > and thus causing crashes: > 1. On classic m68k CPUs with a MMU, paging_init() ignores all memory > chunks below the first chunk, cfr. above, > 2. On Amigas equipped with a Zorro III bus, config_amiga() ignores all > Zorro II memory, > 3. If CONFIG_SINGLE_MEMORY_CHUNK=y, m68k_parse_bootinfo() ignores all > but the first memory chunk. > > Fix this by moving the calls to memblock_add() from > m68k_parse_bootinfo() to paging_init(), after all ignored memory chunks > have been removed from m68k_memory[]. > > Reported-by: Andreas Schwab > Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM") > Signed-off-by: Geert Uytterhoeven Does this patch fix your crash? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org 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