From nobody Wed Feb 5 16:54:08 2025 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1ACE1D7998 for ; Wed, 15 Jan 2025 19:14:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736968488; cv=none; b=W9dBd8Gt1n5PjbDvJDugDvX/OtCxJZXmegEtBx0ph5qzI99+qrMRXV5SGotmNWnIYJTTLpgYI4tliJRbNHhI5kGbQl3IIWdRPmJWrM/ZKtT2XvlTEy0awhIXRkTRnqaQLgdi5IVsy+swoTGaoz+5W52gBvGteTnnELlySc6f7X8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736968488; c=relaxed/simple; bh=9vjtNHx0FqqLcci+rcMEj/5acJBVr9rbniH1U2Dz44w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FN0hKQ87/7bzaoMHWzGfLTyaRHXtjGIHfb0qHpL9X2RsdYv1MaOJLuh4QlQE7youpqPZVsl0xBgStuaJWoeAlrb2TpDARnmzYVwhYYqCNaI2NLjVhbnD+HO8zw6mGXklKnhibjsIbFBgf5GfQXO8rpL9dy5ky2cSRbBbY6rtx0E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=casper.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Ohvp7AhO; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=casper.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Ohvp7AhO" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=zf2GiuF4uGIVUxzkVkUG6Og3XO9L1Q3ObwgFc7LbRWg=; b=Ohvp7AhOn/kgth3HVKcG15a/dZ cqzMDWli/JuSB28oYTi7TAsW3FrXa6yS/U39APw5GlB/nrs/OYi7N+tjsI2crhcYH49jTRf+DLy1o 4fhAosBHkgSXBy1XQSOK6UUvwsCvnv72q2MJHeXM9EMdIatABO3xQFU4fPUY9OnHybF2zZSJkMb0V q7K7u4skgXzHI9bxsHfmLdd9p/EYpaqMQhLyk8z5tk1TWT+JELpC28dRAlgEiCO3PpSSWqUouzl0K WoZaiOnxeYr/yhbb3HhWTXb2veD2vKC6TEqVMQMiALbMMQW6eJUUs/POiDVSeH/2bLiRvH2lSfea1 EL5Bc8sw==; Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tY8qQ-00000000X7x-3IZr; Wed, 15 Jan 2025 19:14:26 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tY8qO-00000002Uvr-3g2F; Wed, 15 Jan 2025 19:14:24 +0000 From: David Woodhouse To: kexec@lists.infradead.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , David Woodhouse , "Kirill A . Shutemov" , Kai Huang , Nikolay Borisov , linux-kernel@vger.kernel.org, Simon Horman , Dave Young , Peter Zijlstra , jpoimboe@kernel.org, bsz@amazon.de Subject: [PATCH v6 1/7] x86/kexec: Add CONFIG_KEXEC_DEBUG option Date: Wed, 15 Jan 2025 19:09:30 +0000 Message-ID: <20250115191423.587774-2-dwmw2@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250115191423.587774-1-dwmw2@infradead.org> References: <20250115191423.587774-1-dwmw2@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Content-Type: text/plain; charset="utf-8" From: David Woodhouse This does nothing yet. Support for x86_64 will follow in subsequent commits, and an Arm64 version is also being worked on. Signed-off-by: David Woodhouse --- arch/x86/Kconfig.debug | 1 + kernel/Kconfig.kexec | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 74777a97e394..c54cbd36c710 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -13,6 +13,7 @@ config X86_VERBOSE_BOOTUP =20 config EARLY_PRINTK bool "Early printk" if EXPERT + select HAVE_KEXEC_DEBUG if X86_64 default y help Write kernel log output directly into the VGA buffer or to a serial diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index 4d111f871951..a65b49c083c9 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -17,6 +17,9 @@ config KEXEC_ELF config HAVE_IMA_KEXEC bool =20 +config HAVE_KEXEC_DEBUG + bool + config KEXEC bool "Enable kexec system call" depends on ARCH_SUPPORTS_KEXEC @@ -95,6 +98,14 @@ config KEXEC_JUMP Jump between original kernel and kexeced kernel and invoke code in physical address mode via KEXEC =20 +config KEXEC_DEBUG + bool "Debug kexec transition" + depends on HAVE_KEXEC_DEBUG + help + Faults during kexec can be difficult to debug. This installs exception + handlers and attempts to report faults. On x86_64 this would use the + serial port configured for earlyprintk. + config CRASH_DUMP bool "kernel crash dumps" default ARCH_DEFAULT_CRASH_DUMP --=20 2.47.0