From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AC6012D023; Mon, 10 Mar 2025 17:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629307; cv=none; b=RWpDVUrV3sAOdpWbYp9gKMhilI6ePfphbtGINf6xmm0sGZ6svJWXJ5stsoFECgNZvoHf/nuaRjrJ+JtrgEzhbFRQhMsevT8HGEw+vmPjWb5/cWTFE9s+Ei0dtWGa183uXbDExvp61D4ujP7Rtl1HkkSlSXbt+BWJHb5XSzEhLiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629307; c=relaxed/simple; bh=3KYEuvqptx7j3RU5HzayR5tORNzHridGw7FXzCoxZOU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PhYAlTG6qx4dPutUvWWfEInVkWtmHkNuQAt4z0KmmcfcDoFiGHrUPWWQHlzr/4AOS3CMD3xBLIqYbI1tUJcW8ZEHzSsXbKRO2CNyp3mRQUnDIo9cTu0rVIdKV2Wa1zClyjSHJMfUYzPZr2OWkRDHsapzoJxBkltLwp2qhoCBjbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N80/6J8k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="N80/6J8k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34DCDC4CEE5; Mon, 10 Mar 2025 17:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741629307; bh=3KYEuvqptx7j3RU5HzayR5tORNzHridGw7FXzCoxZOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N80/6J8krhcVo0++hcP0lpBbwEOJXHIhQH4lu2Ru4MqxPI7ehh/TEejqoZnB4BxYn 7r0zOB4qyqR1cJZ4PC9t5mmxqF4AGoqmZOed4vmoFAh9zCkO9KnsHDMsxeBXhT06fz MF6JlK3QH8NjyW0rcW0RTRrjLXrjE68DcMxxBGlw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Feng Tang , "Borislav Petkov (AMD)" , Ira Weiny , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.15 218/620] APEI: GHES: Have GHES honor the panic= setting Date: Mon, 10 Mar 2025 18:01:04 +0100 Message-ID: <20250310170554.229287908@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Borislav Petkov [ Upstream commit 5c0e00a391dd0099fe95991bb2f962848d851916 ] The GHES driver overrides the panic= setting by force-rebooting the system after a fatal hw error has been reported. The intent being that such an error would be reported earlier. However, this is not optimal when a hard-to-debug issue requires long time to reproduce and when that happens, the box will get rebooted after 30 seconds and thus destroy the whole hw context of when the error happened. So rip out the default GHES panic timeout and honor the global one. In the panic disabled (panic=0) case, the error will still be logged to dmesg for later inspection and if panic after a hw error is really required, then that can be controlled the usual way - use panic= on the cmdline or set it in the kernel .config's CONFIG_PANIC_TIMEOUT. Reported-by: Feng Tang Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Feng Tang Reviewed-by: Ira Weiny Link: https://patch.msgid.link/20250113125224.GFZ4UMiNtWIJvgpveU@fat_crate.local Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/apei/ghes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 160606af8b4f5..a6c8514110736 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -155,8 +155,6 @@ static unsigned long ghes_estatus_pool_size_request; static struct ghes_estatus_cache *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE]; static atomic_t ghes_estatus_cache_alloced; -static int ghes_panic_timeout __read_mostly = 30; - static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx) { phys_addr_t paddr; @@ -858,14 +856,16 @@ static void __ghes_panic(struct ghes *ghes, struct acpi_hest_generic_status *estatus, u64 buf_paddr, enum fixed_addresses fixmap_idx) { + const char *msg = GHES_PFX "Fatal hardware error"; + __ghes_print_estatus(KERN_EMERG, ghes->generic, estatus); ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx); - /* reboot to log the error! */ if (!panic_timeout) - panic_timeout = ghes_panic_timeout; - panic("Fatal hardware error!"); + pr_emerg("%s but panic disabled\n", msg); + + panic(msg); } static int ghes_proc(struct ghes *ghes) -- 2.39.5