Message ID | 20230724100917.309061-1-suagrfillet@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1724509vqg; Mon, 24 Jul 2023 04:14:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2SNTOEbP7nadUQ0QA5S+NtdkYIjCBXS1pVZ/5CBxaKYFViE43QZN/Cfz5dDoxqhAHWjGt X-Received: by 2002:a05:6402:2791:b0:51f:e0f0:f2cd with SMTP id b17-20020a056402279100b0051fe0f0f2cdmr16622628ede.3.1690197254461; Mon, 24 Jul 2023 04:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690197254; cv=none; d=google.com; s=arc-20160816; b=sZEzEELQn8BamRsBh+Wqm+H+84AN5y6tw7Pqrk2BwEzvMCuZK2PCV9xbGfrB53ETH3 usijG1aBfwGTtS85ckCWlGqhN1TYYorpthi5LPy3PtCLu4CogWYfpD36DgCITsisEW+m X8ZZGfMcTRfcf+BnpdoTjF96hfM5lXkD8ZmI8sclYg09fg814q9La+hTg/bho0XIkUqw h7HhUq2x9Apv79NyhpE1QtXOMIp5w5//81FHI2gah9aJsvPo//2T3MAC0PlUCRvZJK9S QXgG9UjJ+nVHnIkcwpCFIsaoxvL4wzK3X9YtHOz4kEuMRkEii+QclCBrSEY+xphUsqPI tZ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RDlfftCqHuUNq6LkkwKxzRiSDkmFGSCz0/vq6oh3T+s=; fh=RlSjNsDiYZ1kvNfMK4OlBVuDVxPB3sSmCG5dgPZgDgw=; b=QydxZOuOI2k/WFtm/33hJU6vrRI7TB4/clu5YW7kMWGDfE9OgioqPCIY1DACLhfuWI i/CaKA3D38CtxVIXyfRwhMa5VbDIPfnfZzgaJVIGVhXw6uPNdkHIQRnK15woxbgU6yyQ NL1CFlfbJznhHUwDtQqQonJyqpYf5njjSHc3cVnoptGyt1Rbgtkok2DeG6ip4v0b6tBp g1BwIzJXYC0hoxgJoMqaHHIPgE0M5H0wSE2xDNr+B+AMMCs/beFpjXESv4mRAVsZnvqn WS4VG2nOZJ56VJIjd4vZSe0LA9r0TfPdKg2Qp8L6cRaG6Pr0bJ1xdFFsMAqoPflr6y2i SI1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="hrex/GaU"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020aa7c3c1000000b0051ddbdeb0c7si6312670edr.350.2023.07.24.04.13.50; Mon, 24 Jul 2023 04:14:14 -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=@gmail.com header.s=20221208 header.b="hrex/GaU"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjGXKRi (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 24 Jul 2023 06:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232003AbjGXKRT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Jul 2023 06:17:19 -0400 Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEB8665B7; Mon, 24 Jul 2023 03:09:36 -0700 (PDT) Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-56597d949b1so2542379eaf.1; Mon, 24 Jul 2023 03:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690193375; x=1690798175; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RDlfftCqHuUNq6LkkwKxzRiSDkmFGSCz0/vq6oh3T+s=; b=hrex/GaUVfMUNZRWvZGpegE4riCW/oOM8uo1UlMmZrlwQR1Y5g9p5yiEY70tHm1Nzn Kr5sAEgXdRnmXkRixZ7uSFsyu3mNjkPZQedetliik0YCgA1z5anwyhWO9wgDZJyycz8L bqVnG2/rUHzputkQE2I8YmX+z8H53N83YyFIUqLlAn9cJmQ4l5FtwSeir3YT0mCh/CG7 JEi1SSLS+YGBbkTVOq9MO8LWjBph4mBH+cWBfdLJUhXU6fvKZdialD83Hcug1zFLoGt6 BHhQtXdk8mLSMT19jnYSRQvWcdarZMfp3CBtw3bGQxqh6FJqAgde0fb2q24nvFcehQ0V 1Kew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690193375; x=1690798175; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RDlfftCqHuUNq6LkkwKxzRiSDkmFGSCz0/vq6oh3T+s=; b=HH3TfRjHnWS8nK9abvA1Fzry8XUzkeK3UrglqfGgYbWjfsuVjOZM72N79wKtn/ayvN prjT/cNuI1siVpZY8AiWsMzdyKzESirDuUCVmI/Ua5zjaSHgqSB4JnqDLwUt1A4Q7g+F OaSdGNpuVrHSaCe9JjYqhEY54b2eS6h7s24OiXQQBrZ2pn6+j+7eSHXuPXXktlQTC5Ek eVMaoDK3DYVInFkNq5WFIB57pHbGODDXcGJMwx6MXdNUuAxRr1D8U/DwiOclgb5FOFfJ GJVPCnLv+WqsVVgBMTqYo16pEHaOoUxAR+zIKOWuUunCxDJw1qU77gmiGKlAuMz6T+Hm ETfQ== X-Gm-Message-State: ABy/qLbfVbDi/kmT9vy5zLi550CfcBOqDaD1wdsGS6qM+2wULgVInhF0 Dn6Le5UK1EwNXOofx/Nj0Hk= X-Received: by 2002:a05:6808:1410:b0:3a3:5fc6:3ba6 with SMTP id w16-20020a056808141000b003a35fc63ba6mr12452468oiv.42.1690193375682; Mon, 24 Jul 2023 03:09:35 -0700 (PDT) Received: from localhost.localdomain ([2408:843e:c90:2347:5782:34b7:c2b6:16d2]) by smtp.gmail.com with ESMTPSA id t29-20020a63b25d000000b0051b8172fa68sm8272826pgo.38.2023.07.24.03.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 03:09:35 -0700 (PDT) From: Song Shuai <suagrfillet@gmail.com> To: 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, suagrfillet@gmail.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 Subject: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Date: Mon, 24 Jul 2023 18:09:16 +0800 Message-Id: <20230724100917.309061-1-suagrfillet@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772299969414819466 X-GMAIL-MSGID: 1772300276340720089 |
Series |
[RESEND,-fixes,1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo
|
|
Commit Message
Song Shuai
July 24, 2023, 10:09 a.m. UTC
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 <suagrfillet@gmail.com>
---
arch/riscv/kernel/crash_core.c | 2 ++
1 file changed, 2 insertions(+)
Comments
在 2023/7/24 下午6:09, Song Shuai 写道: > 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 <suagrfillet@gmail.com> > --- > 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); > } Reviewed-by: Xianting Tian <xianting.tian@linux.alibaba.com>
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 <suagrfillet@gmail.com> > --- > 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 <alexghiti@rivosinc.com> Thanks for that and for the instructions on how to reproduce the problem BTW! Alex
On Mon, 24 Jul 2023 18:09:16 +0800, 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]. > > [...] Applied, thanks! [1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo https://git.kernel.org/palmer/c/fbe7d19d2b7f [2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 https://git.kernel.org/palmer/c/640c503d7dbd Best regards,
Hello: This series was applied to riscv/linux.git (fixes) by Palmer Dabbelt <palmer@rivosinc.com>: On Mon, 24 Jul 2023 18:09:16 +0800 you 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]. > > [...] Here is the summary with links: - [RESEND,-fixes,1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo https://git.kernel.org/riscv/c/fbe7d19d2b7f - [RESEND,-fixes,2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 https://git.kernel.org/riscv/c/640c503d7dbd You are awesome, thank you!
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); }