Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27632114rwd; Tue, 4 Jul 2023 05:51:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEFrZE5DQvM3qNmJjml5VpfvZVbMa67itdOqG+cO5uiVG+7b9yNGIPeX5HXj3qJyiyYuIi+ X-Received: by 2002:a17:902:7b96:b0:1b8:28f6:20e6 with SMTP id w22-20020a1709027b9600b001b828f620e6mr8677659pll.34.1688475084773; Tue, 04 Jul 2023 05:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688475084; cv=none; d=google.com; s=arc-20160816; b=lmdumZ3gIYjBzWpL28GycJjS5hTvHEmaknO6zYltMozZFMngzfs86QOdg/WjR+EiCq FyBnIQigAwBPrU7x2EYI1mxfDp3xThBdrHW1VpKKxtVK5eLQ/VOIq+8Z9bKZ6WylN3oc l+hug9b1sEqIOiYWZ7tpWYkxBdBSGA9cf/ys1bsecIEkyVkHJHBK06NW/H6eZsRqdSbx QOj2ssTwVprgmynIjuMW6OLaj5+g07s8bz8nrMtqVrTqpzSfEQINYgTISqYefGq8tDOC F2pmXEVTOu42hxLXtX631GfX8ej/Wh+0rIuP6H5hK5bzP3adI8ypG3fFHMETuhZm9pkM mlXA== 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=gPfsB1w6O1VgswT9BdYNIdaGg9DM11zYzh/RWpJMbq4=; fh=Hzuqe36b4c2MWNZ78tGzQfMmO/CjURra+ho8i4hbbXw=; b=mu+aHzWcl/pTR5FYuVnC8mAwNTeiqIcSdbG9VLOjcmyeUOPseGC6E9ZO1l6R1QAqdy lo6lEA9YDfAV2HidqA3dSzyRhapIM95MoNTou8IKFMzBSvBAlRNwP90794JC1HL0TfHk D8sdXXY/jf8uMzatFcAxxsOtdoplGrJ3/BOcpBeiDzDgCPK3f5DDQG3NNrTdHKyvRWxV 2IqTyk0pDnI5bSXKMmiuVzHE2vejODeOaEy7J2GiYZR7IviU7uLcKUo1q1WDE5sVSvFm zECS5an02qPGVaOyPYKVZUF3yHTjs2rP5TMo+7gkTpDZoV3GmcVW84rkTkHF+oG0YilW GARA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=2aPYb2DC; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a17090340c600b001b6b08f03ccsi11891281pld.345.2023.07.04.05.51.08; Tue, 04 Jul 2023 05:51:24 -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=@microchip.com header.s=mchp header.b=2aPYb2DC; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231379AbjGDM1a (ORCPT + 99 others); Tue, 4 Jul 2023 08:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231690AbjGDM1I (ORCPT ); Tue, 4 Jul 2023 08:27:08 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3916F10F1 for ; Tue, 4 Jul 2023 05:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1688473613; x=1720009613; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UjTTupn9qJkicPlewg6pVkjIzGItxTvL5gYYji1MF7U=; b=2aPYb2DCVIUzw5M5dHQkXYrU7Uf3E9oFK0yHg6tTadR6pzmS5cUvaSrT TIbncb9inJZPtZ+wdPutUHRVnaOA/yOQlrthLehfyPtnlEseSCNmQ1oBj 1/Rd3QxF/iJZ2TYIFHKu5vjtsPMsOD1lIUBvYBeHPFFXWHFdVLb9E8AVx D1BAY382RHLqaQLck7GwRegNZa9/To8fOKjf+AuxkwBJT/A4jeELjQPPG BPMQ13oxO5uNuaoShNkzpYsxlsmM18132jsXdxonYIeXTPpTIz94+4O7v zBM8awJ9NhmlNU/FVSpSQN0l60mbGxsJzgDmsVNgrsDCIbPjwcgXgC+5F w==; X-IronPort-AV: E=Sophos;i="6.01,180,1684825200"; d="asc'?scan'208";a="221231359" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Jul 2023 05:26:52 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 4 Jul 2023 05:26:43 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 4 Jul 2023 05:26:41 -0700 Date: Tue, 4 Jul 2023 13:26:12 +0100 From: Conor Dooley To: Alexandre Ghiti CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Song Shuai , , Subject: Re: [PATCH] riscv: Start of DRAM should at least be aligned on PMD size for the direct mapping Message-ID: <20230704-emblem-rubble-e4a3a87cb98e@wendy> References: <20230704121837.248976-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9jeWf4lkKbux8HSU" Content-Disposition: inline In-Reply-To: <20230704121837.248976-1-alexghiti@rivosinc.com> 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_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 --9jeWf4lkKbux8HSU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Alex, On Tue, Jul 04, 2023 at 02:18:37PM +0200, Alexandre Ghiti wrote: > So that we do not end up mapping the whole linear mapping using 4K > pages, which is slow at boot time, and also very likely at runtime. >=20 > So make sure we align the start of DRAM on a PMD boundary. >=20 > Signed-off-by: Alexandre Ghiti Obviously correct me if I am wrong here, but was this not reported by Song Shuai as a regression? Accordingly, should this not have Reported-by, Closes/Link & Fixes tags? Cheers, Conor. > --- > arch/riscv/mm/init.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 4fa420faa780..4a43ec275c6d 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -214,8 +214,13 @@ static void __init setup_bootmem(void) > memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start); > =20 > phys_ram_end =3D memblock_end_of_DRAM(); > + > + /* > + * Make sure we align the start of the memory on a PMD boundary so that > + * at worst, we map the linear mapping with PMD mappings. > + */ > if (!IS_ENABLED(CONFIG_XIP_KERNEL)) > - phys_ram_base =3D memblock_start_of_DRAM(); > + phys_ram_base =3D memblock_start_of_DRAM() & PMD_MASK; > =20 > /* > * In 64-bit, any use of __va/__pa before this point is wrong as we > --=20 > 2.39.2 >=20 --9jeWf4lkKbux8HSU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZKQP1gAKCRB4tDGHoIJi 0itCAPwKOEqJ0dNzrojBEleJ+wILpeeIhBt4b6b8vTdYfsnGlAEAkIk4KBiL+H/E ZM9Cl8dBOGiaC3Ewi3Po+ryBoyKNNQA= =fhdf -----END PGP SIGNATURE----- --9jeWf4lkKbux8HSU--