Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1355435rwb; Thu, 10 Nov 2022 15:08:32 -0800 (PST) X-Google-Smtp-Source: AMsMyM5RVZHM4yEzMSkClyoXCtwBIWbr3fBxUQV0a3h+leWbnXRKQmhiY7QsZLLxvmzeYDCau/4T X-Received: by 2002:a17:906:30c8:b0:7ac:db70:2f90 with SMTP id b8-20020a17090630c800b007acdb702f90mr4149262ejb.297.1668121712606; Thu, 10 Nov 2022 15:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668121712; cv=none; d=google.com; s=arc-20160816; b=abSnVYJqTatMbLKys+4HxteatBgjy+bjLQ2JGNxtgGmDU+X0B/Q6SUtUf/c9ER6t1U jGSyHyahLXpxR6lMqBDh2f0TfOVdOgKml45U4Kuq3bCy5Ekjg3I90W1v5LOG3yfhQvfd 3wNj0Q5JgnjxuZvm20Alo9wEydh7DUsoC5w+IN4QDnd1uNpe5qi0RanjON5fgviJc6h+ MHjRyckmUp7Goy2Dzbb2wgUs2UIsuc5dWx6vlk//aYfAf+ykrt4Qb68CkSemm/C+1i+R j7Lzfz7PQl2+yymGSD+8qFJQmiHGqqk1HnqfBYVOfFnbRrW6ATHQIDO5Q4RlujIxMYVF BpjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:date:message-id:subject:references:in-reply-to :dkim-signature; bh=LCiO+gXRF0lDVHlLBo3c4ej39VeZ3e6BYvKE2zsZKq0=; b=J+8kTXgqTFnh+/HQmZsvKooOfKjnUdfN8TdOr25funCPQhpC+TAWSHixIVEu0gogsd /LXxW3oBnI7VBuX3epOqDIEdVPqlj9zA1PPFZ+nDeLAVIv6Mnibv6jAoJzscHVsuUi7P ElhCnh+PZeaQ6TQkVpmed3pg41IoSG3fUluFQ23YxWwiKzo8H8GGmy2U3P0QZvXy2qN8 lPctb41GOVWbzGXuGaRyqi2+wjg0rsw2leOMEvkJJoYZVVFMlGxv5o/gZAHrhkfE7V58 AjbD2Ck4ru5zsdNTSJDvLZc8AwCP0zlSZpDvEjYV2SkUwJhbfiMbOfz+EuU9hMcjoBhB 7ajg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=abTOCpM9; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb6-20020a1709076d8600b0073dced7204bsi483740ejc.767.2022.11.10.15.08.09; Thu, 10 Nov 2022 15:08:32 -0800 (PST) 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=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=abTOCpM9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231620AbiKJW7S (ORCPT + 92 others); Thu, 10 Nov 2022 17:59:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbiKJW7Q (ORCPT ); Thu, 10 Nov 2022 17:59:16 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B38917E17 for ; Thu, 10 Nov 2022 14:59:15 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id p12so2802697plq.4 for ; Thu, 10 Nov 2022 14:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:date:message-id :subject:references:in-reply-to:from:to:cc:subject:date:message-id :reply-to; bh=LCiO+gXRF0lDVHlLBo3c4ej39VeZ3e6BYvKE2zsZKq0=; b=abTOCpM9RICqb1ONalOCn5LkxeesH4sL8drYDcbMXZ7kf00g+YuIpyzU4MM/cveqUN qweuuVXbHDaEYOpB2fvFUJ/8dB8L1x4/dbT3Tw452JhPAxjfIByRa/xziRHAHlkDIQW7 qVvFTRg94rg0VkuoHQkhasr4ks6dXRN7pgaNfFhs47M/OgE9odD2HzsUweTg6tuai6Ea xKpQQVdSrZpzco6K6nR4sCVmSwI1mghyTguejHX9lokPPVS3gk53pqK4lyC+QNGNrpWc ThI6Z0UNwrLX0Jq2x4Ze/dlzkGwrQsC/pu619Mx8MXENmFS23EjZKrOR+p5MSOXfAuEH ZfcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:date:message-id :subject:references:in-reply-to:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LCiO+gXRF0lDVHlLBo3c4ej39VeZ3e6BYvKE2zsZKq0=; b=wIFgy3HZDJLbNEpPlLsMBM7+v5n+HfU92vUdAvg9nIvq/fU5RpF8T1xVlaUTnhpyR9 5mrAOQMc3TpnTAsC+JK3qXyZunqL4LLdOcpvYJcGXng2lQQCgQWB9WD2Om2SIw5KZagS l6PFXejkVfjL5/L2RHSpFQYw5V/7sDCNoBNaa9X4Pa/9J0ZqlXpRHP1DUOIVTvE1yrdX CY0trhaEyydJ9O2v8wtE5PdP/iWa+ngGujs5Jn3zW/JuxGpGSBoGS/H6kvAJMaTfM0mY hDK3XmeGe1Ci0bA9KnbSOHv7q8bKMUJJI5p4OI/YAN9doYNEJq5SaPzT42kNg9TVH2Wq lPEg== X-Gm-Message-State: ACrzQf3nhatzLRnHrTNyEUYm9B/uQ766eWnmyXtfD63xa4Vxfo7FOSGn zTQQ3KFAej7Wskd5gXk+JdnuMQ== X-Received: by 2002:a17:902:eccb:b0:176:cf64:2f39 with SMTP id a11-20020a170902eccb00b00176cf642f39mr2423235plh.93.1668121154780; Thu, 10 Nov 2022 14:59:14 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id a11-20020a170902eccb00b00186b7443082sm196815plh.195.2022.11.10.14.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 14:59:14 -0800 (PST) In-Reply-To: <20221107151524.3941467-1-conor.dooley@microchip.com> References: <20221107151524.3941467-1-conor.dooley@microchip.com> Subject: Re: [PATCH v1] riscv: fix reserved memory setup Message-Id: <166812084905.21827.16442600363878515593.b4-ty@rivosinc.com> Date: Thu, 10 Nov 2022 14:54:09 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.11.0-dev-36ce3 Cc: Atish Patra , linux-riscv@lists.infradead.org, Albert Ou , Nick Kossifidis , linux-kernel@vger.kernel.org, Evgenii Shatokhin , Anup Patel , Daire McNamara , Paul Walmsley , Valentina Fernandez From: Palmer Dabbelt To: Palmer Dabbelt , Conor Dooley X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Mon, 7 Nov 2022 15:15:25 +0000, Conor Dooley wrote: > Currently, RISC-V sets up reserved memory using the "early" copy of the > device tree. As a result, when trying to get a reserved memory region > using of_reserved_mem_lookup(), the pointer to reserved memory regions > is using the early, pre-virtual-memory address which causes a kernel > panic when trying to use the buffer's name: > > Unable to handle kernel paging request at virtual address 00000000401c31ac > Oops [#1] > Modules linked in: > CPU: 0 PID: 0 Comm: swapper Not tainted 6.0.0-rc1-00001-g0d9d6953d834 #1 > Hardware name: Microchip PolarFire-SoC Icicle Kit (DT) > epc : string+0x4a/0xea > ra : vsnprintf+0x1e4/0x336 > epc : ffffffff80335ea0 ra : ffffffff80338936 sp : ffffffff81203be0 > gp : ffffffff812e0a98 tp : ffffffff8120de40 t0 : 0000000000000000 > t1 : ffffffff81203e28 t2 : 7265736572203a46 s0 : ffffffff81203c20 > s1 : ffffffff81203e28 a0 : ffffffff81203d22 a1 : 0000000000000000 > a2 : ffffffff81203d08 a3 : 0000000081203d21 a4 : ffffffffffffffff > a5 : 00000000401c31ac a6 : ffff0a00ffffff04 a7 : ffffffffffffffff > s2 : ffffffff81203d08 s3 : ffffffff81203d00 s4 : 0000000000000008 > s5 : ffffffff000000ff s6 : 0000000000ffffff s7 : 00000000ffffff00 > s8 : ffffffff80d9821a s9 : ffffffff81203d22 s10: 0000000000000002 > s11: ffffffff80d9821c t3 : ffffffff812f3617 t4 : ffffffff812f3617 > t5 : ffffffff812f3618 t6 : ffffffff81203d08 > status: 0000000200000100 badaddr: 00000000401c31ac cause: 000000000000000d > [] vsnprintf+0x1e4/0x336 > [] vprintk_store+0xf6/0x344 > [] vprintk_emit+0x56/0x192 > [] vprintk_default+0x16/0x1e > [] vprintk+0x72/0x80 > [] _printk+0x36/0x50 > [] print_reserved_mem+0x1c/0x24 > [] paging_init+0x528/0x5bc > [] setup_arch+0xd0/0x592 > [] start_kernel+0x82/0x73c > > [...] Applied, thanks! [1/1] riscv: fix reserved memory setup https://git.kernel.org/palmer/c/50e63dd8ed92 Best regards, -- Palmer Dabbelt