From patchwork Mon Jul 24 10:09:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 13324213 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18DF9C001DF for ; Mon, 24 Jul 2023 10:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=OCCe0sEBzgEMW0bz5BFq3anOlk8trD0MdMsh07ud0Ls=; b=AzRx4Z93aESTwC BNyAjoEWSeyaC91WqE2I331U6FrKDSkld5vAl/4f9i5Z0A9hkgw+0j3/wf1C09kwA/wdz2xrQqBXt jCoVB5rE7En1KIJJeW9O0lgdhEr0FS7UnymqEXMM/4zm1jk/dzpkv8v353YzmZVNUM6FSlFgP5W7m xuTTTSFTXdSCVQwJOW7fJTOdQFMA+G50ceAfPn0ZSMrLj6M2pRZAfgzEg7nFR4MIEOmIDplYWnkzz Da7QHfz/QCvSue1HwqHLqtev9XOY4LYsOxhiszSOtQRJ+U3XTHUVmlVVTysrtMNf/aw4XkkrTpXLA xmILorTE1OC7JJ2ZxvFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qNsVZ-003bLt-22; Mon, 24 Jul 2023 10:09:41 +0000 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qNsVV-003bKV-1k; Mon, 24 Jul 2023 10:09:39 +0000 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-56368c40e8eso2553056eaf.0; 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=OSiOio0GzxAZ+SnDpf+oVmuIaXBgghPzX2X4Gm5t2C2xzpxL3LltfPISwy1HSqO0oK lX6jR+Q0A7UboYMfaycVC5ZnkAKgYcqhfopt7Ux3snz2Kl7dONoktOoU3N9Zipr8fFye 4s6licJkoTEM/D27XhbgxCmTiBoB45YMtw8Gr+x39jWURVG8/Rq4HIYe4WQzdOipur3K NmvSIIi58ns1pRjnZAQmlA4TvlXBwcpQfnPi1Yukr8pqQ9jyrdjtX7Ob/mBCP0KfcJuw bvbrcFSCfQhKJ+9YgmZM7iNkn4nNg57RMqI39sggDxIiDtmyidCNSa/GM4EBTIWBKEL2 hSkA== X-Gm-Message-State: ABy/qLa5sxImRvugKsZyXCHL7NYhySSi//x+TVu72fsT0h0RK5dEnsew efG0UZ0bL12/0RzORxR87Zg= X-Google-Smtp-Source: APBJJlHdgdC3rG6LO2coONZP/kkI0Ylc1MgH/PIQ2Zz6Htck/GwFgmmgxR6G3vTB6BKFwu4lvsrr9w== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230724_030937_578352_46E6BFF8 X-CRM114-Status: UNSURE ( 8.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Xianting TianĀ  Reviewed-by: Alexandre Ghiti --- 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: 13324214 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33E9DC001B0 for ; Mon, 24 Jul 2023 10:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Au70+RnBpZROZuhXarjOu/X+1Lhn89lx9MeK+waosbg=; b=VdGVAJcDobmteT M4DdwL+yODUmUa4ATEv43VN8O/SMogCWEdimbKvxyu0m+0LKxRvRvy4P9FkOqi+aVKK8FEw2Fgqvr joh4vI7ht099yq+Us76AHFFirqeSw8j/vnQSGl/Qha3/2RyMr/MdMPsDaOFiZwFfKLkIZbUu0DWTP wdlNDGQiE+3wwO0qBWvBZhJP7DavcBvSVy+2MseZDl6yhcVJ5f/xBBcouRTwb2x7XzmG5zHdM4tO1 ab1chxyx5AoJkx1jyBJ4dJYJTVN7JcHlWGf1H7s7UAy86Su8uxVtedlfly2SmqTtRNjRSfLkyyxte MQNKcvLPrFgNHAjJGaLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qNsVk-003bPW-37; Mon, 24 Jul 2023 10:09:52 +0000 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qNsVh-003bNb-14; Mon, 24 Jul 2023 10:09:50 +0000 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-34642952736so24034265ab.3; 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=Cy9oLrcclUpYs/IpBvOk0eKrvjJxVz6p8g4ydOnu5rCcfWArofOA/4DI9KZVFvGPk/ Fc/m1MbSGzUev3L5lGFHUJM9O814xz7rueSYT2MbHU8Bgmg29s3oi23Cd7p59oFEnQCP 2nZ7lkV1ZScV9+ZKRmxfAI4EduchSlNP9+wDa+wTJQVnDHbiFCebDHy8v5nQ+m4akAam XFjnV4iGDfymqS3f6mBtPdbofICdTRv85+GpNivv0eGWnxpsINUuJ0DC/ciJ7xZRF0MP ZC/makHRVQmYa+DFChCPcPz7kFxYH5QCs5ILUcOhTMjCyYwK4CIHmMcL8O/jtZhipw4p STNg== X-Gm-Message-State: ABy/qLaiwmswyCEUsHuug6leMK5GpSnHzKkXjayNeCQDomUHeDLEFmav 6eLyzUKOBVL0n12NtUxyF3M= X-Google-Smtp-Source: APBJJlHJ5PE83v9b1yIa2tiwwMnAmbYros48TQ/r/GuSfcXorXE/PyaC9/EV9Q/TEW8XN+CxxXkwYw== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230724_030949_369871_074E6289 X-CRM114-Status: UNSURE ( 8.44 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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.