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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCEC4C38142 for ; Fri, 27 Jan 2023 08:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbjA0I6J (ORCPT ); Fri, 27 Jan 2023 03:58:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231902AbjA0I6H (ORCPT ); Fri, 27 Jan 2023 03:58:07 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECCDD298C0 for ; Fri, 27 Jan 2023 00:58:05 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso2904011wmq.5 for ; Fri, 27 Jan 2023 00:58:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PYMteubS+4lwOGc2I7JiDeXqE7nT4Xb62g6ujdBjlpE=; b=gly/Ah19V9gpzED0uxuLEtUd8b2f3KZf9Z3F5llZ7GPh2M2DQsUzBwNWErueqqKwOK 2IAcgKEbiNGtg++g45thG+xXmIA4Tto8tPfjISHiN5h/kUVp0xZnk9tn7XQwdrlWnZkY tn1OOjDuwMXRVnLhLwkJ20zWcnheaHrd95IgmLye+uFgvmHWG9apsp9IubCtRHBI2MzC oIJfLmqRPKMAtFdTD6OUc0pl8hwNl0ALmQnKK8GS6pYz6+ErcmE2MDOlXhSl3sntDOO6 Wo4TU7LR0Ttl99QFAGCq/czH+h4HdB9ejMDMIXBY9mzkXgHaEm4g6jh3Y9R9dVpkCj+9 07Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PYMteubS+4lwOGc2I7JiDeXqE7nT4Xb62g6ujdBjlpE=; b=chzaNHsfLY8RrQfrCDrn+IrsMphMPnLEZkmxJiSWXltCuWQNMJJTyeHMPckl32/P0v ehIqn7kqRSj4QAwsXJL4EoT1dcaKMg19i9441Ir3UyVXrmdy/+IuUAgfncmurr6qIMem Uz5MsUkh5mj3nJmdUWWSpdjO3WWLPKrgF8jl7qZphj3vfePmDfiv95rXT36wdt4YhEIa tgrUv7KCfbDWjHtI6lKSsNDxVXaC6VZaGDDqjknpFZHEQrhROOiqbJN97grUxcOGDD8u TvtZiO2atFEGkMGz9BpoJX3ZHbjDlhEo8Yyw9ez50gAH/wxdfP6QURyAiNNnYPZ8GO3M pseA== X-Gm-Message-State: AFqh2kol9xPYohG399kUToCR/hwTvsKdc2/bGOBsUxiN4GZ6nZaoj9ST crOBNOXUIUONW+6Hb2O5+WEVSQ== X-Google-Smtp-Source: AMrXdXtav/oM3qM10MujDBkbMkvfbbVRSYWQH3g8HyfDNMvHTIctgxxkkiyCrXTT8buQVGYHDEyK7Q== X-Received: by 2002:a1c:f317:0:b0:3d0:480b:ac53 with SMTP id q23-20020a1cf317000000b003d0480bac53mr38981050wmq.12.1674809884477; Fri, 27 Jan 2023 00:58:04 -0800 (PST) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id a19-20020a05600c349300b003cfa622a18asm7342751wmq.3.2023.01.27.00.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 00:58:04 -0800 (PST) Date: Fri, 27 Jan 2023 09:58:03 +0100 From: Andrew Jones To: Alexandre Ghiti Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Rob Herring , Frank Rowand , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, Rob Herring Subject: Re: [PATCH v4] riscv: Use PUD/P4D/PGD pages for the linear mapping Message-ID: <20230127085803.ruj624323wxeyllx@orel> References: <20230123112803.817534-1-alexghiti@rivosinc.com> <20230123142554.f22ajf6upfk2ybxk@orel> <20230125104102.2thvourt3lx2p36a@orel> <20230125151041.ijhjqswqiwmrzljd@orel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 27, 2023 at 09:45:21AM +0100, Alexandre Ghiti wrote: ... > > > > > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > > > > > > index f08b25195ae7..58107bd56f8f 100644 > > > > > > --- a/drivers/of/fdt.c > > > > > > +++ b/drivers/of/fdt.c > > > > > > @@ -891,12 +891,13 @@ const void * __init of_flat_dt_match_machine(const void *default_match, > > > > > > static void __early_init_dt_declare_initrd(unsigned long start, > > > > > > unsigned long end) > > > > > > { > > > > > > - /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is > > > > > > - * enabled since __va() is called too early. ARM64 does make use > > > > > > - * of phys_initrd_start/phys_initrd_size so we can skip this > > > > > > - * conversion. > > > > > > + /* > > > > > > + * __va() is not yet available this early on some platforms. In that > > > > > > + * case, the platform uses phys_initrd_start/phys_initrd_size instead > > > > > > + * and does the VA conversion itself. > > > > > > */ > > > > > > - if (!IS_ENABLED(CONFIG_ARM64)) { > > > > > > + if (!IS_ENABLED(CONFIG_ARM64) && > > > > > > + !(IS_ENABLED(CONFIG_RISCV) && IS_ENABLED(CONFIG_64BIT))) { > > > > > > > > > > There are now two architectures, so maybe it's time for a new config > > > > > symbol which would be selected by arm64 and riscv64 and then used here, > > > > > e.g. > > > > > > > > > > if (!IS_ENABLED(CONFIG_NO_EARLY_LINEAR_MAP)) { > > > > > > > > I see v5 left this as it was. Any comment on this suggestion? > > > > > > Introducing a config for this only use case sounds excessive to me, > > > but I'll let Rob decide what he wants to see here. > > > > To me, the suggestion is less about trying to tidy up DT code and more > > about bringing this comment about arm64 and riscv64 not being able to > > use the linear map as early as other architectures up out of the > > depths of DT code. Seeing an architecture select something like > > NO_EARLY_LINEAR_MAP, which has a paragraph explaining what that > > means, may help avoid other early uses of __va() which may or may > > not fail quickly and cleanly with a BUG. > > > > You're right, do you have some bandwidth for doing that? > Sure, I'll post something today. Thanks, drew