From patchwork Mon Aug 26 06:52:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuan-Ying Lee X-Patchwork-Id: 13777220 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 8E35EC5321D for ; Mon, 26 Aug 2024 06:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=asTw9btpC4r8oJmQ5fgUFJi1d1/GY3upIlP0o+wvCJA=; b=umnzeVOzXFSEywv10lWP8rx7mv tHlMf7pZUaxrwQB5kOBqvMwXjAhwaU9JywJa0IznEKUcu8kon/T1d7qb7Kg9e/jzmcgODUYZnff+1 rthTIseRBVZWrid1XWTsAKO61TxXtaxD7WAU81Bybh1asFQP+gI0WfxKokGOVcklr1ikrjN1+v1mO e8OYvTl4Cx/5nCle74TSJUrdQzWTirl4CLmY5YGNfB+ZFCs/+lBXHh/sYUkSIfsQ/lIFW+irXkhIW WJtBObzQHDaGSFWxJwBL9YfVKpCerueidbSQnQ3SsjrCDe6r6dwN22TDgsX1sgaqyj3qvG/yL28+9 TDl279pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siTfj-0000000699S-2PHf; Mon, 26 Aug 2024 06:57:51 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siTaj-000000067gO-1d3b for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 06:52:43 +0000 Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 9E42D3F327 for ; Mon, 26 Aug 2024 06:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1724655158; bh=asTw9btpC4r8oJmQ5fgUFJi1d1/GY3upIlP0o+wvCJA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=p9EeorMJanp5b8MhTaSguZLNrKbr5CH5lGMpe3DJRNGuqAMmoPLvpHS/SIyuxA/Pj 0kyilzLJ9cY6ICqMYwrhJGVupVZsDFFlk2U+tZrWItxSDI7atNeXI+kEesf7rHOzP8 Qyb8P3fgtGzOuEznckBM0AqswySJOncVNFrZFBHuvzLWg58FbnAgQxn8blplLjSGmw yXsGBNOiMJYjz4rPeXtvCc0BUcI0fzpiOZA3RvFFLKVgHcQ8TQ9Wsl4WF9wDZvMfEQ XqFyYCs36gI1NduN+2ASTLwU1mxS2BzeDuHvMBC4UzVJjvEOJ3N+hLMbBCMVNaf6yJ A9Zz1UnLdXiGA== Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-714203541e1so3697281b3a.0 for ; Sun, 25 Aug 2024 23:52:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724655157; x=1725259957; 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=asTw9btpC4r8oJmQ5fgUFJi1d1/GY3upIlP0o+wvCJA=; b=dIrWQiRyjbcK//1IYP2YJYZvrN7FBRcg87gcG3wAoBFArL6NyKzGDhg9yVLjzRCfUG 6vRRh5AI5/9CVecN/uvUfacXaefDK7R1CxdJ+PAafPALXiw0WQ+KTw/0+r4t/QO1Gj/s v6adR4ju3KnVhWhxOOApTGCk/XHbsZYrlgFongfeSoC27qCUt+k5RWrznnD/ucweL8Pk 472yBcuOhXRxLAeVGzQ97H//tfXdvAHYX4a06Grr7faqJW4m5QnKVpRHt+7PQxgIt8B0 kIwDsgmKO4nkyxLMGRQgY2ZYqqgcVDMCIymqFXX6V4XWhisYbSJgoi2k41onVm8Zdvyc Guiw== X-Forwarded-Encrypted: i=1; AJvYcCWqq1OHTImxhGp7Ub7dLO7880hXNmO661gThQ9jBJPxNA81j0i51nF/a27i0wwN/EYlGh5MHgVm6rMjH4mATTc8@lists.infradead.org X-Gm-Message-State: AOJu0YzJ0fbIG5q3nhufEOTKsimY89/yfw4pspYvk3YBhEvqwUQt/4wr jN49i22d6jbmuL5+lQR1ySIaixSMzshh0pzQk30uRxMYjtQAOFrSavWc6Y+9tuarxh+7mOR8PjM kODhrsOuUlRoERC2a8r1VGDoPl+5GN24PvzQutYDyyouzM7bt4n+HuE6KjXR6cz4BZKdFxT8oXU m7Sr7kXz6NuKQ2 X-Received: by 2002:a05:6a20:2d13:b0:1c6:ed5e:24f with SMTP id adf61e73a8af0-1cc89d7dde9mr10964931637.23.1724655156911; Sun, 25 Aug 2024 23:52:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFshnr0yWWoq+ZC7FQTS4oA6OR3ojKB+L5NDCHocR3E+oUvuPt3+dFTL8nGph077xQHw8MRMQ== X-Received: by 2002:a05:6a20:2d13:b0:1c6:ed5e:24f with SMTP id adf61e73a8af0-1cc89d7dde9mr10964901637.23.1724655156256; Sun, 25 Aug 2024 23:52:36 -0700 (PDT) Received: from kylee-ThinkPad-E16-Gen-1.. ([122.147.171.160]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-714342e09c3sm6472207b3a.122.2024.08.25.23.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 23:52:36 -0700 (PDT) From: Kuan-Ying Lee To: kuan-ying.lee@canonical.com, Baoquan He , Vivek Goyal , Dave Young , Jonathan Corbet , Catalin Marinas , Will Deacon Cc: kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64/vmcore: Add pgtable_l5_enabled information in vmcoreinfo Date: Mon, 26 Aug 2024 14:52:02 +0800 Message-ID: <20240826065219.305963-1-kuan-ying.lee@canonical.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_235241_643237_F3D7E7C1 X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since arm64 supports 5-level page tables, we need to add this information to vmcoreinfo to make debug tools know if 5-level page table is enabled or not. Missing this information will break the debug tool like crash [1]. [1] https://github.com/crash-utility/crash Signed-off-by: Kuan-Ying Lee --- Documentation/admin-guide/kdump/vmcoreinfo.rst | 6 ++++++ arch/arm64/kernel/vmcore_info.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst index 0f714fc945ac..557a1cbe5098 100644 --- a/Documentation/admin-guide/kdump/vmcoreinfo.rst +++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst @@ -466,6 +466,12 @@ Used to get the correct ranges: VMALLOC_START ~ VMALLOC_END-1 : vmalloc() / ioremap() space. VMEMMAP_START ~ VMEMMAP_END-1 : vmemmap region, used for struct page array. +pgtable_l5_enabled +------------------ + +User-space tools need to know whether the crash kernel was in 5-level +paging mode. + arm === diff --git a/arch/arm64/kernel/vmcore_info.c b/arch/arm64/kernel/vmcore_info.c index b19d5d6cb8b3..be65d664bdb7 100644 --- a/arch/arm64/kernel/vmcore_info.c +++ b/arch/arm64/kernel/vmcore_info.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -36,4 +37,6 @@ void arch_crash_save_vmcoreinfo(void) vmcoreinfo_append_str("NUMBER(KERNELPACMASK)=0x%llx\n", system_supports_address_auth() ? ptrauth_kernel_pac_mask() : 0); + vmcoreinfo_append_str("NUMBER(pgtable_l5_enabled)=%d\n", + pgtable_l5_enabled()); }