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 A25221DEFCC; Wed, 19 Feb 2025 09:19:34 +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=1739956774; cv=none; b=Eig7Ghyaav7eZivgnWwps7cNPHc2CXNuHsvWg/F8qo0Akr9d7ukRtfoHu/RkVSf6DB5IqYOV+sMHFfa3vtgzyzoFwc106myqv09fnEB2S5rytqxFPSIe8pn2U25DQiZ+uYr4DWfbaQnRwTMBAD9JoIGFZRJicgVq9BPBZN130nk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739956774; c=relaxed/simple; bh=oIeBVvzWG470IheahXnoiqWHL7VJ1BgE4N43aRKt4FU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sqSKRkMGCrR++CYviKNo8b8g3sRZK7aeWVAfLOOE0lnxCezn2qiMej+EFl8w4n3AHAN5CHkh26WZURcimiQmsPmCmZrDn0HkEACoDw2UeRpUdU63CaZtO7Na/3eONxUICPPwNnrpkeaR5c2kotZBYr/xtiSO2HQJZJXvNekMHRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=X0VcNjrY; 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="X0VcNjrY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F8DFC4CEE6; Wed, 19 Feb 2025 09:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739956774; bh=oIeBVvzWG470IheahXnoiqWHL7VJ1BgE4N43aRKt4FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X0VcNjrYlW1DyT0LPBTDkVgH3aI2TqRxU/tOH2rro7u/PzKmEHngfXW82010GErYt lrO3bpsXCSzv2rEbNyXDuvcg7rTJzmu5fNVkXyBBgwsBA/QCbRSXBCreF3X78hBf53 MznyxpMV8y8qzNK96soRP2zfeOrIY0Ey9GzvnanY= 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 6.1 296/578] APEI: GHES: Have GHES honor the panic= setting Date: Wed, 19 Feb 2025 09:25:00 +0100 Message-ID: <20250219082704.655468342@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250219082652.891560343@linuxfoundation.org> References: <20250219082652.891560343@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 dd808cf65c841..83a4b417b27b9 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