From mboxrd@z Thu Jan 1 00:00:00 1970 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 1CD9DCA6CB8 for ; Tue, 27 Jan 2026 09:31:47 +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:Subject:Cc:To: From:Date: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=63cNnGMBAGWC5nzL3QbwLtWys+9g96Zn+8eBBeQMuio=; b=ednVJb1oovTLDj ZZpraCkInsyxFFTQdWu3+qpgXusTaH/qzdpwpuq2FAO2zUH3ceLGqNE1c7ccS0pF4cMXa+zdDSaIP 1tKJbW5LTO2joIj5KcNr17FVJOfQoTfWxn9onzbNxcYryPTO8zmMlxbxL3Y2lgc30e95I7Yrv6Pss vUOAybyUztwpIF1q4uV0e7wWbIrzNHUpFcZc3uoaoApotfJCWYQEAQIivl/cpSaYXIB33wje0BNKM IrRRCiNiC2J+lWC2XBn2DOGIRn/39+4IN+vY5s2ebu0XjAOjVFkh0wkPmwcKR/ORSv0RnPbU1hDCO 7xbIDR+PJfcfzfy6ZARA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vkfPz-0000000DwOk-3moz; Tue, 27 Jan 2026 09:31:29 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vkfPx-0000000DwON-35S6 for linux-riscv@lists.infradead.org; Tue, 27 Jan 2026 09:31:26 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2a7786d7895so36394675ad.1 for ; Tue, 27 Jan 2026 01:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769506284; x=1770111084; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Nvr2xv+8/kE2Yaa160xiVghqX5wMbpe9ZaewCjQfr5c=; b=Kg55ogZEKB64XrDI1fJBFh5opBSLRp4ftDp+Is3dnXqwKdzW87OenJsI0XHxoh5aJ5 uYLXd0BGQAIWViSI2d794QrN5wjmxQWBku8QN71NTu7l6ipzGw1XkYccN1sVd2fTELe+ icHBaO9yVYdhwVK84vCHUT7/wHk8cyvI4caU3mF5HjShlatqIHa4gRuvGd0aCUFOEtns VqPgXWkBjv9Baqapoyg3MS3XIntTu4ne2itptSl0Www9s1xcDfMyfdsNHTVBYhSkKnHU CR94f5avblr1IJxuqmRxAN1Mly4bS2T8XE/+9aouSj0PNuBP4U7uXdgiqgli6O1S0cJK phdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769506284; x=1770111084; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nvr2xv+8/kE2Yaa160xiVghqX5wMbpe9ZaewCjQfr5c=; b=Dz3jLp1cXxadXWUeTSVKPpt45nJpwN0aJihqZIcBjaBe11ncW755Aiiwa1vnOwU5bb PoSAW6eaK+5N4T+nN3DlWMC9EMl9QMBGA+TwpnGkMIwC0HPwxHut4u8kTBoBKoOBd+UJ aaj2Loa5VN7Azwtj4e7PaKeJXqHGv+gjxODgraI1Y7XHKQictcgiurMjRSu/gZdulKHQ jmQa4JPoH0qpxFUlR5sCzBWX9yAp/96dYusZu3d5q7KmYCxs6otwX6IiZQBUZNXB+4Ki Y9XoBKbXQVvXcJ+yW2y6sTFzTuzSqgEBx7QC35e6rrNM/mNO7ejoUQzc60jJmlZDZoh5 Y32w== X-Forwarded-Encrypted: i=1; AJvYcCVsENhEzT0nqVNqukJpXcqhQehPOfOlLjz3dxsz5Lq/jmklEmVpVSglwZaBUTU1AvqU0v3vxJZN6sHU2w==@lists.infradead.org X-Gm-Message-State: AOJu0YyKmG8+KOohLc0Qy1RbsPZktFRF7nEsBgJawDId5e4f87kGjQNU xmbU9j1vSLgVi0+PZ52fNyG7gixYeJXITdMVgU4BFzsTWX7gQ1mDEi2G X-Gm-Gg: AZuq6aLYpMdMOj5U4wESffwL/JZwsh48Y4VtxOcBF6WmVEKU2Ictv9on6Hs51WZ29en Y0zJ6AkuDxfPepb/NkeZJhiMoB4pbVJ17TEhcTOv9tpjP2n3znvfEmgxcG8Yof4vMxgp15QJpKz t51rDqhkhN6k+hGbI/tlLCZWZAvxfTZXX3CDRbLqnIjoUf3pV2pM72fCzf9vIYYD21msFI7nXfs rvDKdsL5J52p1UTgRSFVeshdbB+V53lVduvt1qvHv94kgrPyWXS6iIdTAGtd/wCKJfkRQ1IVFaE L0Q1zR1FlDWADfzA6EIzk3FlaCLYKs87a7iXBnb/UBEkyLDcyviDRpGltI6S5eqI+CD94Zgaul6 Xqe0Ya3vVWemKhRQDbBrRHZjYyRLti+7D9eLYiWrz9RP/coYBNV7eTReYCNviIVyTFYniLq5SAL W4K5jwMjznK/KhVcSbbmGKfoEfWYk= X-Received: by 2002:a17:903:2b0f:b0:2a0:97d2:a264 with SMTP id d9443c01a7336-2a870dd5709mr10270305ad.37.1769506284518; Tue, 27 Jan 2026 01:31:24 -0800 (PST) Received: from adminpc-PowerEdge-R7525 ([27.122.242.81]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802daa8ecsm112363425ad.17.2026.01.27.01.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 01:31:23 -0800 (PST) Date: Tue, 27 Jan 2026 18:31:19 +0900 From: Austin Kim To: Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, austindh.kim@gmail.com Subject: [PATCH] riscv: export kaslr offset and satp in VMCOREINFO ELF notes Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260127_013125_780202_692DC2E2 X-CRM114-Status: GOOD ( 10.30 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Austin Kim The following options are required by the kdump crash utility for RISC-V based vmcore file: - kaslr: If the vmcore is generated from a KASLR-enabled Linux kernel, the KASLR offset is required for the crash utility to load the vmcore. Without the proper kaslr option, the crash utility fails to load the vmcore file. - satp: The exact root page table address helps determine the correct base PGD address. With this patch, RISC-V VMCOREINFO ELF notes now include both kaslr and satp information. Signed-off-by: Austin Kim --- arch/riscv/kernel/vmcore_info.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/kernel/vmcore_info.c b/arch/riscv/kernel/vmcore_info.c index d5e448aa9..682ba423c 100644 --- a/arch/riscv/kernel/vmcore_info.c +++ b/arch/riscv/kernel/vmcore_info.c @@ -3,6 +3,11 @@ #include #include +static inline u64 get_satp_value(void) +{ + return csr_read(CSR_SATP); +} + void arch_crash_save_vmcoreinfo(void) { VMCOREINFO_NUMBER(phys_ram_base); @@ -27,5 +32,7 @@ void arch_crash_save_vmcoreinfo(void) #else vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n", kernel_map.va_kernel_pa_offset); + vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset()); + vmcoreinfo_append_str("NUMBER(satp)=0x%llx\n", get_satp_value()); #endif } -- 2.34.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32E0822578A for ; Tue, 27 Jan 2026 09:31:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769506286; cv=none; b=rQr0tgofIZHPmtG5S6fmpKz37KzJ2MGcK1U9UmZOZDQqAJQ78TXkT378TXRdkA6Gns579MB5a8TKWyZV1w61TEUBkJGbG6nuL+ot7n02xOFBu4Ob1noKRZl80Hxi/IaZxPXeohNRbRhxej8pnfli3O46TdFdl2PqbR7mEwIrMKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769506286; c=relaxed/simple; bh=5vuZw+X7adFX8VxWvWfRaybAAb51HErm58SijHTE8i4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=mQfiNMxLo6xD07lQYUp5M7xHK/LdSjwQPk8UtLrwgyZnL2i4eVdUetn68LGTMzmvbN/Njm3XwzIf4b16jJohaA+MaNr0gIqqMuP/7xL8/L2fHDtm73JjiNtrR7tE7FvBEkaJWiKSKtMjON4k+niu9qcupTCyDv1kjc5xf1EkoWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QqzwLiTd; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QqzwLiTd" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2a0834769f0so35608855ad.2 for ; Tue, 27 Jan 2026 01:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769506284; x=1770111084; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Nvr2xv+8/kE2Yaa160xiVghqX5wMbpe9ZaewCjQfr5c=; b=QqzwLiTdUTfeKhkvDaERANi8X/OBKpsiwn1qwUTWRvCyZSJJNMejsrmFZRC+6F8yyk NnoyE0zWu+AuCbCN2/hKtuOl1uxTVm9nCU0V48PGvKtt3nXW9ID9zX7Rwka8vEIXtJ1S uY9MCjcpdVaiD4aUa1bsmj2041iKxLka9PLie5oZWAUKcXguL/tFR6tEqrqwH+TvnVf2 bSyLL/JHemosVcffu7ZkQL76gqJMvDq4vLpyMkkG3OHg0s+G177E2qbPTSNa8OM/CBa4 Lj6bF72ApjouuZVNkuz1GeAr0d5g6ttedGiSdFk6vHxAu71h1/XyBxtO7+1rl3LZTBxO n5Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769506284; x=1770111084; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nvr2xv+8/kE2Yaa160xiVghqX5wMbpe9ZaewCjQfr5c=; b=qXtdnjDTLGF3gl1XAoDw9lD1j5fjpDbYCObgOF2FRBD3Tia7hZhRG6hL6HwJBW9rEH cyzRCmY822q/0AEPZ1xXMn7ag2jhFku2J36ojPcqQjf91e7pYPQnLFYUnqlrJtGZNfFs +d6okH8aKR0qQbnObl7D9QJixYK7Fx2fbKfxB9kGmA3Ib3FwcxzTpaxDU62R0doPuqn7 5FnkE+pQSKoeB42X1Luj0A0JnrwjMmnG2+eBKsfCz44kE5//3v/gyiny2Iv4fA+8ClGk j4LUi/4vKQHaMWsAgujZUnsQ4Qhk2RWhhX6Rt27yQCtE+VuyTExaxsRhK9GN/7zjt76k oVVg== X-Gm-Message-State: AOJu0YziezOVg6SnQ68GIIygnQub4feZ/4eW7McTSWhw3EzUrvi/LFvx h567fC/d/9NcUSbHchLFIb0q2IWp9XNhIrqSm+kLgK1Pr3+1wzb7uqrK X-Gm-Gg: AZuq6aIONoAA4YW+q5jdFV6NlNKM4x6iU7qDL2vektEf5F2DZz1d4hHk1WLRMl0Of/7 z/3fjl1ynrkqsxQCflwvTDJkPZU7Icaj0YJdnYQMeyHkr8uHBV03D5Vce9A7kNn9tUoHDB8K4Xx SZlnU23ctKtpXH9ANBOM2ECp068vKFtfide421am27buc2m/Ta+T7hqUHQ9o9lwUjR5/IG1ZPYE SwGGji5X6KIa8HD1yERVyYZadpJmzmnMpefxudaMXD4tA5sqpP+5tT6kxworeOmkiQRRuEWNuUV zRSHgC+RcO+t2qS0Ul4LXDPJLxCOAgl2gnuqmaIl2Oad92UHPiYrrPCN1/m85pWX6cIPBnpmyoP PazG5MzpD1YDQVyqiSKWX8HbxX1WdCKiySxyVVdJ3PbH3XfOJl+ykOhvZVPO9vUw6iDT1Qp2yT2 vLXR7I37m6bVeebbtfo71tghuhxc4= X-Received: by 2002:a17:903:2b0f:b0:2a0:97d2:a264 with SMTP id d9443c01a7336-2a870dd5709mr10270305ad.37.1769506284518; Tue, 27 Jan 2026 01:31:24 -0800 (PST) Received: from adminpc-PowerEdge-R7525 ([27.122.242.81]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802daa8ecsm112363425ad.17.2026.01.27.01.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 01:31:23 -0800 (PST) Date: Tue, 27 Jan 2026 18:31:19 +0900 From: Austin Kim To: Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, austindh.kim@gmail.com Subject: [PATCH] riscv: export kaslr offset and satp in VMCOREINFO ELF notes Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline From: Austin Kim The following options are required by the kdump crash utility for RISC-V based vmcore file: - kaslr: If the vmcore is generated from a KASLR-enabled Linux kernel, the KASLR offset is required for the crash utility to load the vmcore. Without the proper kaslr option, the crash utility fails to load the vmcore file. - satp: The exact root page table address helps determine the correct base PGD address. With this patch, RISC-V VMCOREINFO ELF notes now include both kaslr and satp information. Signed-off-by: Austin Kim --- arch/riscv/kernel/vmcore_info.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/kernel/vmcore_info.c b/arch/riscv/kernel/vmcore_info.c index d5e448aa9..682ba423c 100644 --- a/arch/riscv/kernel/vmcore_info.c +++ b/arch/riscv/kernel/vmcore_info.c @@ -3,6 +3,11 @@ #include #include +static inline u64 get_satp_value(void) +{ + return csr_read(CSR_SATP); +} + void arch_crash_save_vmcoreinfo(void) { VMCOREINFO_NUMBER(phys_ram_base); @@ -27,5 +32,7 @@ void arch_crash_save_vmcoreinfo(void) #else vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n", kernel_map.va_kernel_pa_offset); + vmcoreinfo_append_str("KERNELOFFSET=%lx\n", kaslr_offset()); + vmcoreinfo_append_str("NUMBER(satp)=0x%llx\n", get_satp_value()); #endif } -- 2.34.1