Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3897723rwo; Mon, 24 Jul 2023 19:35:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlEVG0U5awtzBaWXUWrXwPl77347Mz/HK5cn7BwpIO/BUWbQzOs3OxOT/2NjtoI0FzvFPIYt X-Received: by 2002:a05:6402:274b:b0:51e:2c4b:6f1e with SMTP id z11-20020a056402274b00b0051e2c4b6f1emr1061241edd.14.1690252547262; Mon, 24 Jul 2023 19:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690252547; cv=none; d=google.com; s=arc-20160816; b=UMkBcpeQGInOldclWb1XakWf75MkEErpwoXG2yW0xYfGirLYyuQbx/2n6dnjmWjbrH dnKnLx6lbkH9TConcx2XD4r3DH8z3h66F1WmxLfKfAHvjm+wba+EE+5Zjqe01M5/vl4F duXBqRI/Cqxx6ObTIkPphOEgUi/P1wkUnbmjolHGxmpQEVsLMEmP6AN9+0TAsJmUMSg8 +dCBiN7IS4Zlql3vSEr4UmjRedI0fxJrkfuttoe3JKOI2XHTMJsTrCgfv/b/tbYgrGEj U55iNN5PdDgTg0wJ7sd6zoL0c4S+dJ5M41Y8oFwb/ZKBYYIGbytESHmK57b1mdrE9vp/ z1dg== 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:subject:user-agent:mime-version:date:message-id; bh=u1h8saqt8QMJ9QpFbP+NITp4nJsK/9IAbE3x5LqCmaQ=; fh=aWLS7xJztekx+ngbWQXHpw6Bv0bUj89J1G+1eMuFbWA=; b=HnGMBHIzxuSqKCVnF7uJqWJqmWxV8ebQvK53ADDDcmPinK563PFsy9RtND/91h1V0X d/ZFdFzMm6gUwikWlpfmoRfazkotctvZHhKYhgPyhY2l9qVWWOrj9Ty0soXR9kI0fdNs sNUKzZ+3NYGN5o+CgTWF3J8FIpnZ8XDJcg2sdCxrP422zw4TeY5a5lb8dwniM15uRrtJ gBzx9s1yav8VtlpNDMYnWhslVp8T9Ad6c11a2K+LxAiILlHDRg8Bp+O5nPw0RhACApXD 8wyR54IVNqON2c3q51SCLytpqeD+y3kBCDlAQMU/dz9xkVEWsKpTNqk7nIalpbc5cJQz tWLg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z25-20020aa7cf99000000b0051e04f1bd62si7540477edx.199.2023.07.24.19.35.23; Mon, 24 Jul 2023 19:35:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbjGYBwq (ORCPT + 99 others); Mon, 24 Jul 2023 21:52:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjGYBwo (ORCPT ); Mon, 24 Jul 2023 21:52:44 -0400 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD2BD1B3; Mon, 24 Jul 2023 18:52:42 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R891e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0VoAl.6s_1690249956; Received: from 30.221.109.71(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0VoAl.6s_1690249956) by smtp.aliyun-inc.com; Tue, 25 Jul 2023 09:52:37 +0800 Message-ID: Date: Tue, 25 Jul 2023 09:52:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [RESEND PATCH -fixes 1/2] riscv: Export va_kernel_pa_offset in vmcoreinfo 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, 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: Xianting Tian In-Reply-To: <20230724100917.309061-1-suagrfillet@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 在 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 > --- > 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