Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1574703imu; Sat, 8 Dec 2018 02:53:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/UqeA7BQVZMyGZ9SQnGtYbkOTw0Mgmazeo4OYsayQsvpZltx7xaDW0M3IWuIjkA+MNEih7f X-Received: by 2002:a17:902:e18d:: with SMTP id cd13mr5346627plb.262.1544266388265; Sat, 08 Dec 2018 02:53:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544266388; cv=none; d=google.com; s=arc-20160816; b=oENPw2t4ogaQ+s18iCl8hgFc00aNH1ZHG17Qm0p/3p4gmX1vtqnNw6zQgdGpMk3QXl ldzcmxztyjXtJb0acMW5VnsrOSlz1r8sI+6uVDSjV1dsUAqV8CMLha1zEIICXhPD4sAC KUO9kdSrGgv99TsMmUy9vh/kbSJ+Jb5gNk2UAqzrcA3vnHe4dDcbZ6h/+QQto4jxX1pw aKGVejFaiL0nKNic+I4xlumY+nsOTY7UyeHSwEAmHoHoT2NUWDIgC5gF2DgOkGs3p28M ChsS4xWnGzcSoE3Xh3GypU8NFAdh8efCNMU5j9hQZUPV2mLU0wzXxHUCoVKFmXvHA1K7 8rQQ== 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=uR92faYjOGDnSzfrq403TGJDpi1UyEgNqr1tWXpR7fg=; b=f/os856r7VWQ+//9MB3XbDTMciDZeOTDzkF2q3HEgM1l50AGyWqRomAXYaYvTrZGP6 Gx1mNztbvJzsVbQeVhk6oLZQhiivNMqNcaM+LZDcagzakgZxs2tqZwyB6OMV73RXGQhF 40DEnDNw7qD2dFmMyy5Rne7Jnv68L3xF/kLFvJEymSlJqxjywZZdfxps18vNpMLxiqWn CnexMQ1tcIRZHt1aNyfmq7AwbDf3qgWHMNEPF7Tjo5w5bvcH3231iCNM1DF73xL7Jp5K o4ULVNXR48wO/du0q6GrYuxnQR0Ze73L9xp4JR+f8lLg5IgbDjYFpTGIXgyzVKNIMECX OKhQ== 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 k5si5588284pfj.153.2018.12.08.02.52.52; Sat, 08 Dec 2018 02:53:08 -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 S1726179AbeLHKvw (ORCPT + 99 others); Sat, 8 Dec 2018 05:51:52 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:46004 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbeLHKvw (ORCPT ); Sat, 8 Dec 2018 05:51:52 -0500 Received: by mail-vs1-f68.google.com with SMTP id v10so3953230vsv.12 for ; Sat, 08 Dec 2018 02:51:51 -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=uR92faYjOGDnSzfrq403TGJDpi1UyEgNqr1tWXpR7fg=; b=FNxhEnHQ140TyMSo5OEQcG2j6rXAytQ9uSZEHJC7xaVLLBs6APyAJ3QHjC3R5GWfDf YjqKcfxbeo03YRzQiA0eOHjGO2hrGojNlMrVMv3eTksramUbYt9K1NpzTlDVOZuTL7/s BfnoLPnxI81rprVMbvGEKU+zqCjSmAejUKa09Hu2m+YZMX2HdE8GHklEOnZ0bnD2eT0R xAJUvV4HEH4Q9hwE2sWl0Yc/XYsKmW80tOMowPe9ttiVNEiTua4rLP8K1QtkrX3GRm50 4yiJmJIR3u3pLB8+qwkM29ADHkBIUTGasrJvKuXhqrTS/nANsUeZ2LhUghknOIv6dJS8 bO7g== X-Gm-Message-State: AA+aEWZgumyVM1Ra/DAfOeuSjUR/KrT7X1wj9GCQ8bC1yXiB7/Sski+s QG16QbGLsy/EvJv2ki6TE+DxsIwi4eE5wO4+EXk= X-Received: by 2002:a67:c202:: with SMTP id i2mr2152477vsj.11.1544266311089; Sat, 08 Dec 2018 02:51:51 -0800 (PST) MIME-Version: 1.0 References: <20181207165011.31497-1-geert@linux-m68k.org> <20181207210224.GA19067@rapoport-lnx> In-Reply-To: <20181207210224.GA19067@rapoport-lnx> From: Geert Uytterhoeven Date: Sat, 8 Dec 2018 11:51:38 +0100 Message-ID: Subject: Re: [PATCH v3] m68k: Fix memblock-related crashes To: rppt@linux.ibm.com Cc: Andreas Schwab , Michael Schmitz , 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 Mike, On Fri, Dec 7, 2018 at 10:02 PM Mike Rapoport wrote: > On Fri, Dec 07, 2018 at 05:50:11PM +0100, Geert Uytterhoeven wrote: > > Sun-3 must be broken before this fix, as it fills in m68k_memory[0] in > > config_sun3(), i.e. after m68k_parse_bootinfo(). > > Sun-3 is not fixed by this fix, as it uses its own paging_init(), not > > the one in motorola.c. > > Fixing Sun-3 requires adding memblock_add()/memblock_reserve() calls to > > the Sun-3 memory management code. > > I think that adding memblock_add() to config_sun3 would be sufficient, > something like the diff below. This will make memblock aware of the > available physical memory and it seems there no allocations in sun3 before > paging_init(). > > diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c > index 542c440..9a5b9dd 100644 > --- a/arch/m68k/sun3/config.c > +++ b/arch/m68k/sun3/config.c > @@ -150,6 +150,7 @@ void __init config_sun3(void) > > m68k_num_memory=1; > m68k_memory[0].size=*(romvec->pv_sun3mem); > + memblock_add(memory_start, memory_end - memory_start); > > sun3_bootmem_alloc(memory_start, memory_end); > } Thanks! It doesn't need a memblock_reserve() for the kernel, as memory_start is already adjusted for that, right? Anyone who can test this is on Sun-3? 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