Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4163141rwo; Tue, 25 Jul 2023 01:21:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsFJPanOFlokkOFAOXtBc9Av59OLSv+H26t/nteANGBqpiy+dEkBltgNIEi6aJl50FtLsa X-Received: by 2002:a17:903:22c6:b0:1b8:41d4:89f with SMTP id y6-20020a17090322c600b001b841d4089fmr13346288plg.4.1690273285415; Tue, 25 Jul 2023 01:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690273285; cv=none; d=google.com; s=arc-20160816; b=q/J+OeeW6l+keT4YEuU+CaXkgNn0PECsJZQKBbmvw2Slwto1WBBaVQFFfZd92dBk7y N+GBIIMFaaTwBwftzoUOWkvClAlbIj93855EISECX4vW9W/7ngIffiUVv9FR0ewFV+Gl w0tMiugLvmSlJVwFMs8e/+eSWm8sPmlwzne+wYlV01fQe5sns/0MORjNA6Y0uN4fmbI3 Z3wg0sjBJdehSDNyHwV6/MopnKiHg4OoGQijVbJN1B5H1gu+Ul6ylk03Ld5b+K6sWu5P gwV5eNFfl6A+Yvj8Nzx5idHrrIK7rGjnv4m63Lyco5E8/vZEzd82Q9yYOAp4Svg+ZZaR gJTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=mdI+GMgR/lCm6J1KGLDNOa3sDA+kWIeVmL4kdpdkzcs=; fh=dSoTuMaUrj6WO87KTl2eYe7F05zSzFhQ+08A7Xa2has=; b=PUMBrKSQZF6cfXv/3flybMshdaSyY35RnNA9o5xKNU2SfRl2M03Wj8pLNiablE0/iQ BTjN1WMiJ31k2knSzk7M73KwYsyxYEkUvb9ilWEGody8iA6k2uMxiBcgGdLvNETf8o1C Erw6CW2rdUNEJRmdCfbE02C6U7wN14OXrPc8ocKaZOOGwZW1VHqnjlpU0rUGGJsGUwR7 wRSG5tzH+yOIN8L5mzNUSF324WqKFhtwlQ6KW2pIupryOT+vo+GH6iMC5KCGdCiqfSYH CahsSy+2uOZDvdczVKkiVITJXZYOG0a+J9CDQ8m9fc4Mqq3XywrbboUxtoEqFKli4DWK 5ZHw== ARC-Authentication-Results: i=1; mx.google.com; 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 h15-20020a170902f54f00b001b8ae8ed8c3si11922544plf.535.2023.07.25.01.21.12; Tue, 25 Jul 2023 01:21:25 -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; 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 S232742AbjGYHqj (ORCPT + 99 others); Tue, 25 Jul 2023 03:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbjGYHqc (ORCPT ); Tue, 25 Jul 2023 03:46:32 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D21797; Tue, 25 Jul 2023 00:46:30 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7306D1BF20C; Tue, 25 Jul 2023 07:46:22 +0000 (UTC) Message-ID: Date: Tue, 25 Jul 2023 09:46:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Content-Language: en-US To: Song Shuai , bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, corbet@lwn.net, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, xianting.tian@linux.alibaba.com, anup@brainfault.org, robh@kernel.org, ajones@ventanamicro.com, alexghiti@rivosinc.com, conor.dooley@microchip.com Cc: kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org References: <20230724100917.309061-1-suagrfillet@gmail.com> From: Alexandre Ghiti In-Reply-To: <20230724100917.309061-1-suagrfillet@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, 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 Hi Song, On 24/07/2023 12:09, Song Shuai wrote: > Since RISC-V Linux v6.4, the commit 3335068f8721 ("riscv: Use > PUD/P4D/PGD pages for the linear mapping") changes phys_ram_base > from the physical start of the kernel to the actual start of the DRAM. > > The Crash-utility's VTOP() still uses phys_ram_base and kernel_map.virt_addr > to translate kernel virtual address, that failed the Crash with Linux v6.4 [1]. > > Export kernel_map.va_kernel_pa_offset in vmcoreinfo to help Crash translate > the kernel virtual address correctly. > > Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") > Link: https://lore.kernel.org/linux-riscv/20230724040649.220279-1-suagrfillet@gmail.com/ [1] > Signed-off-by: Song Shuai > --- > arch/riscv/kernel/crash_core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/riscv/kernel/crash_core.c b/arch/riscv/kernel/crash_core.c > index b351a3c01355..55f1d7856b54 100644 > --- a/arch/riscv/kernel/crash_core.c > +++ b/arch/riscv/kernel/crash_core.c > @@ -18,4 +18,6 @@ void arch_crash_save_vmcoreinfo(void) > vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END); > #endif > vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR); > + vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n", > + kernel_map.va_kernel_pa_offset); > } You can add: Reviewed-by: Alexandre Ghiti Thanks for that and for the instructions on how to reproduce the problem BTW! Alex