From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BE76C433EF for ; Mon, 22 Nov 2021 20:58:57 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Hyfl35CH2z3cBs for ; Tue, 23 Nov 2021 07:58:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Tgb5Ic+u; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::636; helo=mail-pl1-x636.google.com; envelope-from=calvinzhang.cool@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Tgb5Ic+u; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Hxksr6mY1z2xsY for ; Sun, 21 Nov 2021 20:01:34 +1100 (AEDT) Received: by mail-pl1-x636.google.com with SMTP id b11so11501266pld.12 for ; Sun, 21 Nov 2021 01:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uQeJj6IFfvjTH7tZDTd0bi24dF8RigJdyTH2xVfGgTs=; b=Tgb5Ic+uwSSoM4JZA36HMAnlatkdP+klPPLN5bBR4mKKK7eTLYbvh8o7E0EcmDPq2Q qLbdPM+Vl8mxGeh64K6wzQ+bz31be5sOsZRi7/BFqa+3UZR2mkUMH1od5ApykCQ4oge7 PWRsbIqGPWCVfPaQ/9SinTdE1/ZkUXrgz0XtKq4W6GhO2Tqz3W9WDL2YZ864OPwKasYW XOd5tML9uld3R9EbWMfJk2iapJud7W6QS3RAsn8xBt2Px10d2Ru8NLyAcujfPW2JGJIW WoJyuNX3QATWQwrzDElQcMEP/yNoxhjpnku/gWQVFiahs4VyOBv8MikwZLaNOsRVBr4h 1RLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uQeJj6IFfvjTH7tZDTd0bi24dF8RigJdyTH2xVfGgTs=; b=wm8AKfcc5NX1wPi5Xw3imAUb+AljtyOYU9bEzq5cJUednsgZdQtw21TvFDvTvY5O5K jQhQjlmIFqNpQKOnxdngSCuG/T9PnIcZPO20rOwvKVvhuzUokFD/lYaEJXIqws7/IKfD zE4kYsAss18mWidwvaiwUB5l+V+bbCD797I4lWM7DZ/PnSi/jrnAP9ubYXKQrY/UQ0qY y5VmrlKTUCmYkEhPF6hnJtm0AWfRXfR5/kN1LAQRtXzGIKMNwSBbFpUcRp7O8+YJTGMd c/4rnjmi291MX+dBjCM6LnQC8iq272d3V50m4pqMC9dqpcbJLmI1GGJAb3/vKTYna/WY 2qKA== X-Gm-Message-State: AOAM5320ciF3GFu4SRCCZSQu0QTiz9gFRLqjLcY9e0/dJvLs/j6qWY2n ZtCxCNgNnGJZ1Z8G9vHHzJU= X-Google-Smtp-Source: ABdhPJzLtHKp3ARITLkl6IEvP9ASH3fdvPyqX2o54+OrpL9oFv6P8ZWeoiFpXMGZlDp44TWDeD62sQ== X-Received: by 2002:a17:903:1d2:b0:142:24f1:1213 with SMTP id e18-20020a17090301d200b0014224f11213mr96857331plh.81.1637485290032; Sun, 21 Nov 2021 01:01:30 -0800 (PST) Received: from localhost ([103.99.179.247]) by smtp.gmail.com with ESMTPSA id lp12sm4320990pjb.24.2021.11.21.01.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Nov 2021 01:01:29 -0800 (PST) Date: Sun, 21 Nov 2021 17:01:20 +0800 From: Calvin Zhang To: Mike Rapoport Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction Message-ID: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Tue, 23 Nov 2021 07:57:41 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Kirill A. Shutemov" , Mark Rutland , Kefeng Wang , Rich Felker , Jinyang He , David Hildenbrand , Lee Jones , linux-kernel@vger.kernel.org, Max Filippov , Anup Patel , Guo Ren , Guo Ren , linux-csky@vger.kernel.org, Nick Kossifidis , Vladimir Isaev , Tiezhu Yang , Vincent Chen , Will Deacon , Markus Elfring , Vitaly Wool , Jonas Bonn , devicetree@vger.kernel.org, linux-snps-arc@lists.infradead.org, uclinux-h8-devel@lists.sourceforge.jp, Yoshinori Sato , Palmer Dabbelt , linux-sh@vger.kernel.org, "Rafael J. Wysocki" , Russell King , Ley Foon Tan , Geert Uytterhoeven , "Aneesh Kumar K.V" , Catalin Marinas , Ganesh Goudar , David Brazdil , linux-riscv@lists.infradead.org, Guenter Roeck , Alexander Sverdlin , Thierry Reding , Albert Ou , Arnd Bergmann , Anshuman Khandual , linux-xtensa@linux-xtensa.org, Vineet Gupta , Andreas Oetken , Stefan Kristiansson , "Russell King \(Oracle\)" , Rob Herring , Christophe JAILLET , Greentime Hu , Paul Walmsley , Stafford Horne , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Andrey Konovalov , Christophe Leroy , Chris Zankel , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Alexandre Ghiti , Nick Hu , Atish Patra , Greg Kroah-Hartman , Randy Dunlap , Frank Rowand , Serge Semin , Dinh Nguyen , Zhang Yunkai , Palmer Dabbelt , Souptick Joarder , Marc Zyngier , Mauri Sandberg , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote: >On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: >> The count of reserved regions in /reserved-memory was limited because >> the struct reserved_mem array was defined statically. This series sorts >> out reserved memory code and allocates that array from early allocator. >> >> Note: reserved region with fixed location must be reserved before any >> memory allocation. While struct reserved_mem array should be allocated >> after allocator is activated. We make early_init_fdt_scan_reserved_mem() >> do reservation only and add another call to initialize reserved memory. >> So arch code have to change for it. > >I think much simpler would be to use the same constant for sizing >memblock.reserved and reserved_mem arrays. > >If there is too much reserved regions in the device tree, reserving them in >memblock will fail anyway because memblock also starts with static array >for memblock.reserved, so doing one pass with memblock_reserve() and >another to set up reserved_mem wouldn't help anyway. Yes. This happens only if there are two many fixed reserved regions. memblock.reserved can be resized after paging. I also find another problem. Initializing dynamic reservation after paging would fail to mark it no-map because no-map flag works when doing direct mapping. This seems to be a circular dependency. Thank You, Calvin