Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1616095pxk; Tue, 1 Sep 2020 03:23:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynFSIzGWjopNaudhCT2ZRNPIWjw9YxK9Rlx5awLtQgmQAZvSOkUNaGmYntZ4vkvQudPlHv X-Received: by 2002:a17:906:43c9:: with SMTP id j9mr823405ejn.542.1598955827035; Tue, 01 Sep 2020 03:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598955827; cv=none; d=google.com; s=arc-20160816; b=xhojHDWEtwzp20fBpxRiWfqH62pbpUrLRY04S2qSySwF7yllq5k+X0VxHh04uiA+t3 6zupqB2/h+7lK3QpDtpxTLLjRDbW878x0v+hLA1xgSI2k60ZqJgkX2y9ZRiUPXF5rZZK PYX8RWzfyCDFWPlpMVQBljgnbzrs6eJwEPNsJddbFZTZsMHNUoYtk9zJfWIYPWuDwHxs BwKhm2QtYnk0bBGIvOK2G5ZwB677YcIzdyp+b4tJvsRhXbESValioJROl+04mYA3kf12 /FHQlMFDJWiUL7/3tis37EpmTHDy/8JViroffw20920OCp5MNxCcOwVf+OZgwnlgqmC+ pWEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mzeTFMKOo8l9sbsoHTHy+DYgTJIcAYGM2OFDh+7YnV4=; b=oBRuHhKwZZq7qyQ+V3eVbrgPMyqNrUNkLb4PhDYF41V+qrgqTC4iVbpaoO7+FPzr5r 0yjkwcL1xvX1Mkxh7JeRgb2UXleGdRcJWO/8J/56xHl4sO423pjJMF2ZZAQBe8cVU5nf s7UKzvIEcyQWlg7fNhGNhCD69x6IMb/cVh5z7iwZXrI2MpEywnbe0E7apNxW2/0ykC+I xUgZsC9VnxP0tgLVWTvjoU2YxtCBPQC9CUbCMWdMr03RKvPStHQg0KdWKQ1Hrw4l0AfE R2lJC49GJv/EJuf1e0Rt7xwxZ5jd6viwbWg51g1zKqMEYPPnyty06YNTNb8Oc+SYLRzg 1+lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="E7o8/lr3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si400165ejc.171.2020.09.01.03.23.23; Tue, 01 Sep 2020 03:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="E7o8/lr3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726244AbgIAKUt (ORCPT + 99 others); Tue, 1 Sep 2020 06:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgIAKUr (ORCPT ); Tue, 1 Sep 2020 06:20:47 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B79C061244 for ; Tue, 1 Sep 2020 03:20:47 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id y6so303079plk.10 for ; Tue, 01 Sep 2020 03:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mzeTFMKOo8l9sbsoHTHy+DYgTJIcAYGM2OFDh+7YnV4=; b=E7o8/lr3uAunH7766jfVTNlEN0CaV5kQIR+1FxqhDZDFBUwie7v0cdNC3ZbsBbTwDW +q4lKTh3I50jyruF0Kf3GRS8uJTb792Xm4Jhs2JT7Q2DnQ9BJ/xlCazanECpcRi870+o 5abkQRfsQP/YV+g7FrifUOvzIYMibmvNZXSeHxQDlkWaCl/NXQfZ7mFLxEeaX+Pqilmi FqN1HbwLtcqnQ6Q3PvbJsdsNFIO0hQJVVQRMIFIA8hQazuz5wgoFXFAXszuUq3ER+nNs hZ2l+cWIInGBLtg8bGm5yxfNnX50WFaPlhD0IxIWcuzi63OxYbAB/jHesJXFf8vLDVZU WWbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mzeTFMKOo8l9sbsoHTHy+DYgTJIcAYGM2OFDh+7YnV4=; b=A34vunFGCgQ0Wk/yw9qeqEEeZCHeSHeKrBZmK3la1iF4blhEnrcv1AKPJN8XEvF7nu cnz0m69jW1X56uJomsrXDTx49cphwvrGDvHEs5dtVLmeAuzZppjGytLmEsxN9VFhrNwJ 3mdb607B/EB7CKXvIWtz/PmX+dQGEog66jDckyciiTZlr8Ai4R5u7gVnq5h5CBLDC/5s iVtNN8phtiC6cUDjp7q+XYEqzyHx9O33zonM419FUzE//tI6ZLaaZPrLSZr39N9kwJvE enkqI5R7eIKqjb/yh0JKOQGooi8N3LsXKN8MIvS+/hS+hD3fM+nNrBW3d7HIXrpbwvJO KX0w== X-Gm-Message-State: AOAM531gCh+l+n0nF2MKKerSVe+p+mDpSC5imstJHQoSbJ+pmSSaU0lX CLr/9AOwVfrVR4I2gPqrl906Tzwlfwc= X-Received: by 2002:a17:90a:4401:: with SMTP id s1mr863684pjg.79.1598955647085; Tue, 01 Sep 2020 03:20:47 -0700 (PDT) Received: from localhost (g223.115-65-55.ppp.wakwak.ne.jp. [115.65.55.223]) by smtp.gmail.com with ESMTPSA id s67sm1352506pfs.117.2020.09.01.03.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 03:20:46 -0700 (PDT) Date: Tue, 1 Sep 2020 19:20:44 +0900 From: Stafford Horne To: Mike Rapoport Cc: LKML , Jonas Bonn , Stefan Kristiansson , Greg Kroah-Hartman , Andrew Morton , Arvind Sankar , openrisc@lists.librecores.org Subject: Re: [PATCH] openrisc: Reserve memblock for initrd Message-ID: <20200901102044.GB3562056@lianli.shorne-pla.net> References: <20200831212102.4014642-1-shorne@gmail.com> <20200901055924.GC432455@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901055924.GC432455@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2020 at 08:59:24AM +0300, Mike Rapoport wrote: > On Tue, Sep 01, 2020 at 06:21:01AM +0900, Stafford Horne wrote: > > Recently OpenRISC added support for external initrd images, but I found > > some instability when using larger buildroot initrd images. It turned > > out that I forgot to reserve the memblock space for the initrd image. > > > > This patch fixes the instability issue by reserving memblock space. > > > > Fixes: ff6c923dbec3 ("openrisc: Add support for external initrd images") > > Signed-off-by: Stafford Horne > > --- > > arch/openrisc/kernel/setup.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c > > index b18e775f8be3..2c8aa53cc7ba 100644 > > --- a/arch/openrisc/kernel/setup.c > > +++ b/arch/openrisc/kernel/setup.c > > @@ -80,6 +80,15 @@ static void __init setup_memory(void) > > */ > > memblock_reserve(__pa(_stext), _end - _stext); > > > > +#ifdef CONFIG_BLK_DEV_INITRD > > + /* Then reserve the initrd, if any */ > > + if (initrd_start && (initrd_end > initrd_start)) { > > + memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE), > > + ALIGN(initrd_end, PAGE_SIZE) - > > + ALIGN_DOWN(initrd_start, PAGE_SIZE)); > > + } > > The core mm takes care of reserving the entrire pages for the memory > reserved with memblock, so it is not necessary to do it here. Thanks for the pointer I guess what you mean is it is not required to do the page alignment. I used other architectures as an example and most do the alignment, I think for most architectures this can be pulled out to generic code. -Stafford > > +#endif /* CONFIG_BLK_DEV_INITRD */ > > + > > early_init_fdt_reserve_self(); > > early_init_fdt_scan_reserved_mem(); > > > > -- > > 2.26.2 > > > > -- > Sincerely yours, > Mike.