Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1397426rwd; Wed, 7 Jun 2023 15:56:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68/mewaPYwgmNtPwyCfT5RieXOq6bBg31uM+aQW2/S0MxX4ZnN/75t+h9YzBCU8HXXN2BA X-Received: by 2002:a05:6a20:7fa5:b0:10c:67c9:2fda with SMTP id d37-20020a056a207fa500b0010c67c92fdamr3364428pzj.40.1686178562707; Wed, 07 Jun 2023 15:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686178562; cv=none; d=google.com; s=arc-20160816; b=bJvncjmTWEI/Iu6TdeXfUSo9RfiKLp0fD6PqzXLrBXTgplt7X7YH7SAU7Rcv0Tf3U4 /b30Vj06kuHaGxddxHy9FUtiTNPbxldSCGi5qmrRCqnp9usKtoVMeP/0UsTau/jZv49S nI1A5DYBwCQj3GVXpEgnz4fygsj5zB91rGqYD+qMEM5B6oHUW+ycbdDTAnabINLh7/FU cQFNdWEs/UDpsvhVjvYf2DOhdbyAFPHqxCLqZFuGBZ87xbejOajQcIzO1i9/1VfCcaj6 ytdZul9U8oOLVajrGEAMZTMq1SPJ7crqfy9pqj/91VXQcjECwd0mWyB+7CEpI2pHZCo+ LqbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7WZB//6TJZux+eIfVM5THT4BLYriCbmT8b7UggsWed4=; b=LsDdcCJApJP4DdQvfsqHld0SMECtJK7VZiZ2clK5Rr5KQHv3x7xXDFF0CLO4lCfB0o 3O0QkQLjVNd6RpiiXfsmqEKRvg6+3WWVJ9OwDISk4JlzRfsuh2IvMbK3zFJ20qJO5Vmu C7ahbE7CvPa//jd7HwxSi/7yndXHeiw794qkVJM0mm2s2uA6/hGflwrGDR+Xrfka3L+X FteYhCfw2KiKRs338yoPkN1KdrzNbpJfL4/h756xGnhXNQbhRraD3JqN3t5PJHRVwOsI miL/QDhTKZhFGU2oDQGh4VxLTvTKRH+/NVLlZAanHSvOVydbsQMbWMHsP/iWIhNpQeHe ahAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k10EP806; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a637352000000b0053f23ffad1csi9678831pgn.544.2023.06.07.15.55.50; Wed, 07 Jun 2023 15:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k10EP806; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232277AbjFGW0P (ORCPT + 99 others); Wed, 7 Jun 2023 18:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232129AbjFGW0N (ORCPT ); Wed, 7 Jun 2023 18:26:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8012B2722 for ; Wed, 7 Jun 2023 15:25:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B3FF64AA0 for ; Wed, 7 Jun 2023 22:23:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6618BC4339B; Wed, 7 Jun 2023 22:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686176615; bh=7WZB//6TJZux+eIfVM5THT4BLYriCbmT8b7UggsWed4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k10EP806TuBF1JLTa/5s0Eogr6K+35AL8jjrWVMVXwMxFCd4ZgaEnV4O1kDnUbEXc MHksuOROiiqDhm/CIifxeX3LZ5qYzA7o+7LQ1aAZVbhtpE4qZv60JlHxXtKtgaGkUY tzZmcKEo5l2Eg+EOZ2jAXxNsaPXtE/psAYSHEASPUj99ST7KZobcdGgBukqq+/S1io OyV7qVUPYadi5zvv4QZsVmmL7ob/gfP/otq05ftyXG4qWtsp77INJk2V4P1XIYPFnb +fTbLOlLBTOni8S9oCEqA2mBrhwxOuWSuv/5a7dft1mgcwadeDO54e8bdGkgH/bLqF 9rWyrOdFb8lmg== Date: Wed, 7 Jun 2023 23:23:31 +0100 From: Conor Dooley To: Woody Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, alexghiti@rivosinc.com Subject: Re: [PATCH] riscv: reserve DTB before possible memblock allocation Message-ID: <20230607-unruly-encore-e00661704b71@spud> References: <20230607-jogging-grudging-70dede86bc53@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iroTKYY20BMB+hrX" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --iroTKYY20BMB+hrX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 08, 2023 at 06:17:22AM +0800, Woody Zhang wrote: > Hi, Conor >=20 > On Wed, Jun 07, 2023 at 07:17:28PM +0100, Conor Dooley wrote: > >+CC Alex, you should take a look at this patch. > > > >On Wed, Jun 07, 2023 at 09:35:19PM +0800, Woody Zhang wrote: > >> It's possible that early_init_fdt_scan_reserved_mem() allocates memory > >> from memblock for dynamic reserved memory in `/reserved-memory` node. > >> Any fixed reservation must be done before that to avoid potential > >> conflicts. > >>=20 > >> Reserve the DTB in memblock just after early scanning it. > > > >The rationale makes sense to me, I am just wondering what compelling > >reason there is to move it away from the memblock_reserve()s for the > >initd and vmlinux? Moving it above early_init_fdt_scan_reserved_mem() > >should be the sufficient minimum & would keep things together. >=20 > IMO, moving it to parse_dtb() is more reasonable as early scanning and > reservation are both subject to DTB. It can also lower the risk to > mess up the sequence in the future. BTW, it's also invoked in > setup_machine_fdt() in arm64. I'm fine with the change either way, so: Reviewed-by: Conor Dooley Mostly wanted to know whether you'd considered the minimal change. Cheers, Conor. --iroTKYY20BMB+hrX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZIEDYwAKCRB4tDGHoIJi 0qaSAP9p8WmnDgqGTpmUYr2HQW4T7TMTPFK2n+EWI1gMRejlQQD/b640SeGyJ73C iIcpx6Qh2bBLuteKWiwmHGemZvXGBAE= =Xh0P -----END PGP SIGNATURE----- --iroTKYY20BMB+hrX--