From patchwork Mon Jul 24 09:57:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 124803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1721839vqg; Mon, 24 Jul 2023 04:09:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlEvZfVENEH5z/GuCf7xTx4Nx9vQGlx7x8j/A6KBF5elKWsx7AegjbsZYTjWdAqnC4MVT9oE X-Received: by 2002:a17:902:db05:b0:1b8:9552:2249 with SMTP id m5-20020a170902db0500b001b895522249mr7850993plx.43.1690196962057; Mon, 24 Jul 2023 04:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690196962; cv=none; d=google.com; s=arc-20160816; b=zTslae2o5SkXhfMdatpjiSEUYrd7/x9176ChFPpnA1tBN28gnqXj6GC5NKFzQR/h3j cetGm4tX2CWt9w/f9gxn8ZtlFlt+O0zgAQ9jayGlf7hqk9gXyArYLUzU0LinhttBtkJI oCvHUzkZjKdP4KCKaTkyUQr5O8lhlyimlQQcH4Ic5yqZXMFV697vpL3dEoGZ3d+Sf+L3 PevaGSRuyV0naVwNqSjXt0inzNayC4aGjnZ9X1EaEpGpL4mTPZ8ymzSl//hV0sVEefVF ucJid02M4g4tsLK7GHx0Ml1XawzIe0EYE/RGKZKG8xLLQ8J5yhThNmq9EBB48B8LYCdw eEUQ== 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=koou9lAjxSt3Gd/jB8BAjiG6B/42O4lKY+HerQe/WYlqGI3IvDvw9dsUI3lzMhdN46 Rtj7dkFCWm3m86+kIcLObWfvgzATCKkGyg1n5bZ2b7SGx/5tpyiPQJaDk1Py3YlArA95 t4F4KvcVdWnQC0Sk4Ao86ofglyhQI7NOcbyYxFuwAK7foTRCzTjcL9mkJZnmYK5hTNfL Vw29BM9VfvBGHULH4Mb9XBofy6Jm/TUHPD57JAvGieHIuckCp1C8R5jjVdhkwK5z0w6/ AwVdWYvJHg9dFA1f8TC2uBggqkwfm6uAetkYXDrU9vrHpZ5ZhGLV/zGY6R01AWNCQTIL L/JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DSXykGWL; 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 m6-20020a170902db0600b001b89f653005si9313013plx.394.2023.07.24.04.08.54; Mon, 24 Jul 2023 04:09:22 -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=DSXykGWL; 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 S233100AbjGXKHO (ORCPT + 99 others); Mon, 24 Jul 2023 06:07:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233060AbjGXKGt (ORCPT ); Mon, 24 Jul 2023 06:06:49 -0400 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A509583D5; Mon, 24 Jul 2023 02:59:18 -0700 (PDT) Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3a3373211a1so2491743b6e.0; Mon, 24 Jul 2023 02:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690192735; x=1690797535; 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=DSXykGWLjFrMqpPv66tlr93X7a0vmBHxz/80vR9k8v9lxYIlxldXX+1QWnvqrVQiPL T9Z0gIzVebVrJtp/2dD1t24vN029WXT4YJv6bfRGMsyfrY7Ev7oCdHj/SdtZ3eKyWxJ1 qp1KSO0l/8QzlY8IcUxvUKiFg83LuDfw9+RP1+s/OGqqqy/Py0x9QGfKA9M186kkmNxK PsY/yS3fIWwz3Wa/OVWrLwpf8y9A0QALq0ODtl9acsl6mEWViFV/17vEYrEyFlXN0Mpn b5wly/Nqx3jOJrPhGkUvcatvS4JRzlZvhfIA4VyebxQJiDaXw3czDVbLLBv200CQBMbz S8tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690192735; x=1690797535; 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=hlN12kPJz4SLuUOvrtSpXgWR52DyrWUq07zVdDOedyHFq2XwT+qdY/95eqTYvwrnkM Zf7QZ2vDqQSLTj6xO88vYWwNAdNd9KgyMMEWhApohKeds0+2tW3r1jRaVImkXIzmyd3c 3zDwU9EPb+DpBsM7D9+AujCwGNyhhME3xPd6IE3amUr5umMcofas+boraY9BoMuDq0xO rrfPchQ0Iylo/rjnEEiZUsKOKSUHiX7+lv/6oZeJN5r2/AEOyJiDDC1fNZtjbgniZfXq CAyVybM/PwXFPaz+zHaNmj7l/GCi4FDcd62hNYRxmGn1PCNTVRWnbNEAENmLAq1he4ib kFyg== X-Gm-Message-State: ABy/qLZPT2qStzSjldPCAItxc7AIGzQpF/zHgrywPXuvaXmL/T0qvN4C 7Ev3QIhjK75gL3OUO3M1RcQ= X-Received: by 2002:a05:6808:98c:b0:3a3:7ecd:7d32 with SMTP id a12-20020a056808098c00b003a37ecd7d32mr9466634oic.30.1690192735254; Mon, 24 Jul 2023 02:58:55 -0700 (PDT) Received: from localhost.localdomain ([58.240.82.166]) by smtp.gmail.com with ESMTPSA id d12-20020a63734c000000b0055acfd94c20sm8174380pgn.35.2023.07.24.02.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 02:58:54 -0700 (PDT) From: Song Shuai 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: [PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo Date: Mon, 24 Jul 2023 17:57:44 +0800 Message-Id: <20230724095745.286695-1-suagrfillet@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772299969414819466 X-GMAIL-MSGID: 1772299969414819466 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); } From patchwork Mon Jul 24 10:09:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 124788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1707641vqg; Mon, 24 Jul 2023 03:38:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlGyQcl1sXWAPl76RZIyUHe/ZY3YmKx85F224zV/rv9hFuQaytJI6Wc9NFwTjZs9wFAvxcz5 X-Received: by 2002:aa7:c0cb:0:b0:522:21a1:4245 with SMTP id j11-20020aa7c0cb000000b0052221a14245mr4002468edp.27.1690195082388; Mon, 24 Jul 2023 03:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690195082; cv=none; d=google.com; s=arc-20160816; b=azynasqbjRcNZb7qERLbWQ466LPNHruUP+1Q9wuEs9HkHlz7J03KEFIQxSoA77AREo x8vS71qjtFT1gnAoj+IC6BdsscWYvJsK0xinUPMc61MF5Y77cloAB/ANCuHTpSnV/ao9 T5+EoABGLo1QzxsYhDVT/LC6ey2ZuG1b4nXsgDYL1fQCgHFp2Naxi93FjBU8CYv1cwFA 50HNK0eqVfknUwMEAFXD9Su0MRdDa3QCrydB3YzJPcwzB9dS4sj05BZM9inJRa7duQGO xt3/bMNti3OW805jHkZnvYq7mgRzyLNqjhtOqc6ByoJ7Ih/2MriKGYtr8Z+jL3JKVc6x KyeA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Vwxb4dr9ed/m5CEyUxwJ1RrHPJUl/WASFTIF6qacv2g=; fh=RlSjNsDiYZ1kvNfMK4OlBVuDVxPB3sSmCG5dgPZgDgw=; b=JEappRHULIPWp9PILYOtas5R7oMYX8qQGiJELxg6p/aMFr7iJqA7VXoaRZ8/tOJJcd DEN0c+RXzUCJRGOnXy5hCjX8IxLvaTKoKkrsRmNNPgahCAjsMVGa1/VEONnWluwE0Igg rFvB+6IS47MIJSMb96YTDTLSmFx9DkzqmwpC6YXpudCnLRdRaGdsXBQBfCVqXvNt1G2P ROYxIQBuva8j6cYIuzHKdrDPM1XjpGeu+tkP9dyV+Z1cZf4nIWaKkBUdW0fEUJGBe0M/ 5AasPiMSpnSFFZa4+NcE1f5MlsvCShmCe6vWWHfmrEfohg/hDiNJfu2Lj8siH7v7992Y R63A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=VD0Nxzaw; 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 bf24-20020a0564021a5800b005221f404a63si2646785edb.380.2023.07.24.03.37.37; Mon, 24 Jul 2023 03:38:02 -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=VD0Nxzaw; 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 S231591AbjGXKTK (ORCPT + 99 others); Mon, 24 Jul 2023 06:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbjGXKRd (ORCPT ); Mon, 24 Jul 2023 06:17:33 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E58C8A47; Mon, 24 Jul 2023 03:09:48 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-34884a8f285so24131625ab.0; Mon, 24 Jul 2023 03:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690193387; x=1690798187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vwxb4dr9ed/m5CEyUxwJ1RrHPJUl/WASFTIF6qacv2g=; b=VD0NxzawoiPeT3noLpC6aX3MxiFFLuHuf3NInzssCr435rIpjai1Q9BKajTHw377io aXSypTdyUU+RFfzj2Zr9fY4+fYt5SJX0e+Vyy+XxqgO3jmXJEByYRFRtziGQzbao7+EF lA6e/r7AXXdNRbfFEaN7L4pzWHV9yf3b4SstMGls2JQpxcPFJZZPqG4VrKwfmUQkRsRr oTtZ4iW7aj1br5A6e/Y/BP1G4KeI4pUH+Pahde61X+gUa/GdrUCSMcFV6VgBciamhSP2 z/1aqxOd8/QuVJJsh34jNZnDBMwHRpa4bgSn/smjgD3YFNYeixnDN1ipAKBxBFRwj+TT kMQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690193387; x=1690798187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vwxb4dr9ed/m5CEyUxwJ1RrHPJUl/WASFTIF6qacv2g=; b=UlcC3O/LMKyeIGmEDnebtK9EReQyEEK1DGJxCWIRSUOQE5DdtWl8xDbQAyLhCZK69B cf5Ncr1TgHYDEXet1UaTq/ZqpbF6OXUC6Of1dlnGYm2nkdQYg05Om2wLhgBVGzNbZhXy +SLReRLg+jh6UYOXX7bhouvbj2hfc3hx1QGRXtWHTqepfn1bp+7Ckv/luzPmzDEtuIdd lX5XUO30tzutLauX3xGZmHvKn0mEN2HTfG3uenhceQ3ET58WRgq4V9uycG1s1gJEhAvd +sFvC3vg9VZbjMzt6hYeAd3Azm2j2vHgF42DGZHbw93QFpkJA6/dIWU5H46MTNFglXS8 8I2A== X-Gm-Message-State: ABy/qLYLzm9iZSwlE2X2pIN8PbbpjRATkqyVQZi7F+iOqrUQSqcnr/wX DbB+tLiSMeA6Vp2SruZ0eU4= X-Received: by 2002:a05:6e02:20e1:b0:346:e96:7cbb with SMTP id q1-20020a056e0220e100b003460e967cbbmr9064158ilv.30.1690193387442; Mon, 24 Jul 2023 03:09:47 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 03:09:47 -0700 (PDT) From: Song Shuai 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 2/2] Documentation: kdump: Add va_kernel_pa_offset for RISCV64 Date: Mon, 24 Jul 2023 18:09:17 +0800 Message-Id: <20230724100917.309061-2-suagrfillet@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230724100917.309061-1-suagrfillet@gmail.com> References: <20230724100917.309061-1-suagrfillet@gmail.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772297998648343046 X-GMAIL-MSGID: 1772297998648343046 RISC-V Linux exports "va_kernel_pa_offset" in vmcoreinfo to help Crash-utility translate the kernel virtual address correctly. Here adds the definition of "va_kernel_pa_offset". 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/ Signed-off-by: Song Shuai Reviewed-by: Alexandre Ghiti --- Documentation/admin-guide/kdump/vmcoreinfo.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst index c18d94fa6470..f8ebb63b6c5d 100644 --- a/Documentation/admin-guide/kdump/vmcoreinfo.rst +++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst @@ -624,3 +624,9 @@ Used to get the correct ranges: * VMALLOC_START ~ VMALLOC_END : vmalloc() / ioremap() space. * VMEMMAP_START ~ VMEMMAP_END : vmemmap space, used for struct page array. * KERNEL_LINK_ADDR : start address of Kernel link and BPF + +va_kernel_pa_offset +------------------- + +Indicates the offset between the kernel virtual and physical mappings. +Used to translate virtual to physical addresses.