From patchwork Mon Jul 10 12:56:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioanna Alifieraki X-Patchwork-Id: 1805804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=jx64Rpot; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R03sv32mMz242Y for ; Mon, 10 Jul 2023 22:56:34 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qIqR8-0000kZ-7p; Mon, 10 Jul 2023 12:56:18 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qIqR5-0000kF-Pb for kernel-team@lists.ubuntu.com; Mon, 10 Jul 2023 12:56:15 +0000 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (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-0.canonical.com (Postfix) with ESMTPS id 633AC3F730 for ; Mon, 10 Jul 2023 12:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1688993775; bh=0UYU8rvocn9Ibgq8wo/Fgc5z8MwoqdrWAfDylkrczFw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=jx64RpotmLO9C5qYtsc5q8Mt/CUGmqPosrzOv6Ry+QeNbm98HCrWmwfDzxO2eELlL dS4qcVD1zoy58TslJGQ/OqL/ys7NMiue0nMMaQ6a13EkYsj2smSBdbzQUR2PVXsTP8 UIdEXwlH8ZsAeUSyB2pR5+zD3TnsBnAhYrLkDcRewWJqpXCwt0WUvX3aUh115Qw7af aTr5lsJFeqJSZhUq4MiT+6X+PybHzAxj6WwhBdxwGGhJ/G9ft1qflvDqPPYEYx69kF BBGrEzqzl7nLWgEZDU0lAeSzFkHIIxZiHNx1Ph3lWwySTmx/znJKW7ncXNpu3cIbC3 AWrqYmZeXrQNA== Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-51bef8bb689so6700333a12.1 for ; Mon, 10 Jul 2023 05:56:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688993775; x=1691585775; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0UYU8rvocn9Ibgq8wo/Fgc5z8MwoqdrWAfDylkrczFw=; b=WOe1Bh+DqaW1Md0oQBp3NBrodgzqFmF64ZZBAYxdaDrdhtKdGCWwlUIHMOkWCYq1oI V1pPmQOL4BqKNH05mRirCeEq5aaGpSeNCwjzgI1aV5xMIWrglIoFGVxag9Tuz0mT7nTx mjGGVmjQesrT3X0LUFHnjRZnv5qZQyIsEsNQX05YP3BQumDn7Lw1N+UMMUYaMhWorMhl v2looJWKdy7WJDIPYIW9oE6D+SCdDxjKfgR1PtJl0iHenefnHpsWM4eSunCFEquDYxeU Qo77AjnUhrlw8zzqp6mumOxbmOMyD50W7QluibKtwZt3fH0i9sAIxz7kw06OtxIR8cWq VLAg== X-Gm-Message-State: ABy/qLZV5MbRk7+M0uVqPkIHAK9IvFgpA0Zn+aBqsvyi3qjaNXgIILva hTK8r+ylaMexw+HWP6OcSAW1Q1G2Yd7EQOaZpWsF0YkZ63qAD+gw9Qdta8BI39WtoIoJYphuoNW JEpSKQtt2/Qqu4L4m4Kyw54Cy+v97Nq9q8SS9zrwFYopZf7BBOg== X-Received: by 2002:a17:906:6a23:b0:991:f0dc:c930 with SMTP id qw35-20020a1709066a2300b00991f0dcc930mr18132381ejc.16.1688993774846; Mon, 10 Jul 2023 05:56:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHVQYJP+SrKdpl3BXsVNXJ7Whv14lDb7mFWRJe1/n46lJGBq2Ih70yV/5VWJYoUA/x+gzbFmA== X-Received: by 2002:a17:906:6a23:b0:991:f0dc:c930 with SMTP id qw35-20020a1709066a2300b00991f0dcc930mr18132356ejc.16.1688993774493; Mon, 10 Jul 2023 05:56:14 -0700 (PDT) Received: from t14s.. ([212.251.14.163]) by smtp.gmail.com with ESMTPSA id m4-20020a170906258400b00992025654c4sm6133605ejb.182.2023.07.10.05.56.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 05:56:14 -0700 (PDT) From: Ioanna Alifieraki To: kernel-team@lists.ubuntu.com Subject: [SRU][J][PATCH 0/7] kdump fails on arm64 when offset is not specified Date: Mon, 10 Jul 2023 15:56:05 +0300 Message-Id: <20230710125612.37735-1-ioanna-maria.alifieraki@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2024479 [Impact] kdump fails on arm64, on machines with a lot of memory when offeset is not specified, e.g when /etc/default/grub.d/kdump-tools.cfg looks like: GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=4G" If kdump-tools.cfg specifies the offset e.g.: GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=4G@4G" it works ok. The reason for this is that the kernel needs to allocate memory for the crashkernel both in low and high memory. This is addressed in kernel 6.2. In addition kexec-tools needs to support more than one crash kernel regions. To address this issue the following upstrem commits are needed: From the kernel side : commit a9ae89df737756d92f0e14873339cf393f7f7eb0 Author: Zhen Lei Date: Wed Nov 16 20:10:44 2022 +0800 arm64: kdump: Support crashkernel=X fall back to reserve region above DMA zones commit a149cf00b158e1793a8dd89ca492379c366300d2 Author: Zhen Lei Date: Wed Nov 16 20:10:43 2022 +0800 arm64: kdump: Provide default size when crashkernel=Y,low is not specified [Test] You need a machine (can be a VM too) with large memory e.g. 128G. Install linux-crashdump and trigger a crash. It won't work unless the offset is specified because the memory crashkernel cannot be allocated. With the patches applied it works as expected without having to specify the offset. [Regression Potential] KERNEL 5.15: To address this problem in the 5.15 kernel we need to pull in 7 commits (see [Other] section for details). The commits cherrypick or need minor context adjustments. All the commits are changing code only for arm64 architecture and only the code related to reserving the crashkernel. This means that any regression potential will affect only the arm64 architecture and in particular the crash/kexec functionality. However, since the reservation of the crashkernel occurs at boot up, potentially things could go wrong there as well. [Other] Commits to backport *** JAMMY: kernel (5.15 kernel): a9ae89df737756d92f0e14873339cf393f7f7eb0 arm64: kdump: Support crashkernel=X fall back to reserve region above DMA zones a149cf00b158e1793a8dd89ca492379c366300d2 arm64: kdump: Provide default size when crashkernel=Y,low is not specified 4890cc18f94979b406f95708f8cb238eb2d0e5a9 arm64/mm: Define defer_reserve_crashkernel() 8f0f104e2ab6eed4cad3b111dc206f843bda43ea arm64: kdump: Do not allocate crash low memory if not needed 5832f1ae50600ac6b2b6d00cfef42d33a9473f06 docs: kdump: Update the crashkernel description for arm64 944a45abfabc171fd121315ff0d5e62b11cb5d6f arm64: kdump: Reimplement crashkernel=X d339f1584f0acf32b32326627fa3b48e6e65c599 arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Anshuman Khandual (1): arm64/mm: Define defer_reserve_crashkernel() Chen Zhou (1): arm64: kdump: Reimplement crashkernel=X Jisheng Zhang (1): arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Zhen Lei (4): docs: kdump: Update the crashkernel description for arm64 arm64: kdump: Do not allocate crash low memory if not needed arm64: kdump: Provide default size when crashkernel=Y,low is not specified arm64: kdump: Support crashkernel=X fall back to reserve region above DMA zones .../admin-guide/kernel-parameters.txt | 15 +-- arch/arm64/include/asm/memory.h | 5 + arch/arm64/kernel/machine_kexec.c | 9 +- arch/arm64/kernel/machine_kexec_file.c | 12 ++- arch/arm64/mm/init.c | 98 ++++++++++++++++--- arch/arm64/mm/mmu.c | 6 +- 6 files changed, 116 insertions(+), 29 deletions(-) Acked-by: Tim Gardner Acked-by: Roxana Nicolescu