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 96A7725DCE5; Tue, 11 Mar 2025 15:06:48 +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=1741705608; cv=none; b=pcHRGkBAZDPzLgg7LKLwnGV9AESzdU9QqJe8NwJsArik8OPvrm+SLSEZWVW1TdY48ERBdsJeOyx9dLXXJ4xmsHDG+x1podk28ONLjW0n1KY8MrKr2nNSuW3WNN+cVN+PyPioNFJLpTwWQGfTVUIYiYqrO1Z14hzvgvGKH3s7rbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741705608; c=relaxed/simple; bh=YXKMS3tFC2cMAk+DhA17hP9q9JQhOsEaHmfI7F5kBx8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=faPe3VpyEig6FCbnrnPAoO/3n7MgIbrobc6TcgBpLHQSojShUewX2FnTihSXpaFdAeM1wJOYXu7ky7nPX2PYpXZ3fBtUzGexmv7FLL+Q5wOTkimQiBhfBp41oqYUeVGy11GsW3V0ggb9/XNKoFE1DJ+ECGBHkgwf3yFFQo2CZpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=l3XDhVRo; 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="l3XDhVRo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A257C4CEEC; Tue, 11 Mar 2025 15:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741705608; bh=YXKMS3tFC2cMAk+DhA17hP9q9JQhOsEaHmfI7F5kBx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l3XDhVRomsbVYNfm6tOTXiYPNA3IXoM011ROM4aQN5quITZhk2LqwXNOUdgvgXkay NqYl2diPp2YNRv+957g0b0gb9xWGDqN/ezHMcgAmoJNMGT5x6JkcB+AYqDeVcW/WNa vft1on39oaR4HC/M7aEmvs2pqyJXsa2NiVCmhUbI= 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.4 094/328] APEI: GHES: Have GHES honor the panic= setting Date: Tue, 11 Mar 2025 15:57:44 +0100 Message-ID: <20250311145718.628610427@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145714.865727435@linuxfoundation.org> References: <20250311145714.865727435@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.4-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(-) --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -128,8 +128,6 @@ static unsigned long ghes_estatus_pool_s 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; @@ -707,14 +705,16 @@ static void __ghes_panic(struct ghes *gh 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)