Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1877280lqb; Sun, 26 May 2024 23:42:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQKyYCyzPxERPq3a6IG15z7OnQ9vasVyWL1UanA89Xgyb1ebx+T3o7mk57+GwktMis6t6Jx3V4aXC658GaBQGqkSeFeUMtcB9lgyRGtg== X-Google-Smtp-Source: AGHT+IG2f+RMtxraAb0UlwAN/r+loa7RCIrIgdCPumeckUmM6QbmPV77bimgptxn77M1UTuHSwoG X-Received: by 2002:a05:620a:57d9:b0:78e:e8ae:c15d with SMTP id af79cd13be357-794ab1243abmr795150485a.63.1716792145727; Sun, 26 May 2024 23:42:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716792145; cv=pass; d=google.com; s=arc-20160816; b=jewkTyGm8499+HGle+Lcln4c1UuDT4fXLwaruLeaENnfgm1E+8c359BL8bytIjbohi hkAUpWcrJCKYMkzjXqnF11wbHPzM7++thkzYCbJ9l1ISXIFzxLlOX3IXn1gRrY6QYBT7 yysrxSIddQRq175p6jEPVoyALMWkOiRFD9p4U57Xbc/r40QI09SuXiZ3SP51GHepYigg gLmjfmCL4sZdDkUGfp9kx2OKZcVeVNe6szFmLGU0iatxKLPH24t8Qu8OTPxkBeON4zuR pzcR+Q3PNGLim9gmEOiiN56OUObtbXt9TOLC9VQx2yjan/WUPN6Gzu3xkAT503b5uoPe E+KQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=Ypq720fklC/HaR4UTxfPN0fK1+MPpff79Yq5uFGIqB0=; fh=PhrbYesnj3ZLIFhKxT7ugscMjVXvoEXfS1Ce4ay3g1I=; b=o42l8DhC4C+8h0M4hf5TqUlYp7ld6TynuaS8L/hVWoDHKVviiA3Mt90QqhWybQtsAj ewCzbj8vkGeXRE8AKdxhrdLzUVDZEDxsHJ958P1cKSbAbeiPSvS1Y3GTZ5HEZWLKvFZi UTdDQe1vdW/Ix0ehXhG7PtpL75G+8vkPp6x0ar3GLUadkczQrSL9bFto0q8beLYImzf/ ErvjOhLZiSFkQbGWae7YdIq9f4+IQxPFeSHXo7oXUgaIv/4Pe0UVAKvB0HZTNsZiPP08 kEfXof/zi29hyJmlZxHTLXsGBLSU182f7q1xjoBaXFJYFiIikFVyVdCLaaduOjBWO0f0 Y4Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xKwVz7Ri; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-190100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794b00d624esi662746785a.601.2024.05.26.23.42.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 23:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=xKwVz7Ri; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-190100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C6BB1C20CA7 for ; Mon, 27 May 2024 06:42:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F256813C694; Mon, 27 May 2024 06:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xKwVz7Ri"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TorGkXxy" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 EE03B13AA2D for ; Mon, 27 May 2024 06:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716791910; cv=none; b=rSjK8dwn/1if+oyYZ057HHa3Il+28gOq5509ABnNAJBgPQVR0XOaLAz2dPm+Z6azHLMkxf/HkEQVjM48rFEz9qf5Q4UpGEZCx8nuPT1rBYV6DQzRh+qXBnOHk8XStuSFUeBPxzLw0WleOmFUEtm/1uj4oba6PcKxndZGA5KkCW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716791910; c=relaxed/simple; bh=ApV3BrzIy3FzvWp+ns3WoghCqTJI0MOJzDStPgz0cJY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=px8XYre+nIXyap7zpBfy2adVlEXlIQfT3bJDCTinxI/ZEWzON0ECAPRSKd4uNaKbAOq1VgA9DM3hxWWk9qLkIjAFhrpC2wlPqafVph+KAbKGsWf7QQvsfxA7Mx0lpgnN440FxalLEx0xE20N0+OBgk6dSeuaLuay8CUCIuXT4dg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xKwVz7Ri; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TorGkXxy; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716791907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ypq720fklC/HaR4UTxfPN0fK1+MPpff79Yq5uFGIqB0=; b=xKwVz7RiSbkQ6LlCzh2pdMGlVTnTHcm80TDxjCbg98R66FcxTCVE276nR9ikUB3MgWLi+w dT2csWpy4EYXIbqxSZcPUqMqbiI6Lqr13wXPJ9OcuuANggqPvo2Y6CFK76j9mm/9WYxeHM r0CME2p0PREryWHTPXTcWis6lPEUd8HKOZs+5K1EJ4I8qjijhAdsN4u6uoWwnIU/2Z0M6w SlHMCl9E0AfmaDeqmCkYdwxMX8ktmV3DqlGAG0jp3b/zyLOvqW9JvCSCBZj/QGtTIFjDni GqZHtLyUcuIJqhpay/2cv8L7eTEK/WH5COJ9sFKZgJM9QzvV7B28mNOhLeGVIA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716791907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ypq720fklC/HaR4UTxfPN0fK1+MPpff79Yq5uFGIqB0=; b=TorGkXxyqExrWA7fo16ISDGIhpNuo1sMGn4Cc0BBLveKqmAuU3HBCaF6DxM3YmyjGqd127 a46Oi2RTTYvIFPAA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Ingo Molnar , Arnd Bergmann , Uros Bizjak , Kefeng Wang Subject: [PATCH printk v6 28/30] panic: Mark emergency section in oops Date: Mon, 27 May 2024 08:43:47 +0206 Message-Id: <20240527063749.391035-29-john.ogness@linutronix.de> In-Reply-To: <20240527063749.391035-1-john.ogness@linutronix.de> References: <20240527063749.391035-1-john.ogness@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Mark an emergency section beginning with oops_enter() until the end of oops_exit(). In this section, the CPU will not perform console output for the printk() calls. Instead, a flushing of the console output is triggered when exiting the emergency section. The very end of oops_exit() performs a kmsg_dump(). This is not included in the emergency section because it is another flushing mechanism that should occur after the consoles have been triggered to flush. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/panic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c index ee03193f9495..3754a2471b4f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -634,6 +634,7 @@ bool oops_may_print(void) */ void oops_enter(void) { + nbcon_cpu_emergency_enter(); tracing_off(); /* can't trust the integrity of the kernel anymore: */ debug_locks_off(); @@ -656,6 +657,7 @@ void oops_exit(void) { do_oops_enter_exit(); print_oops_end_marker(); + nbcon_cpu_emergency_exit(); kmsg_dump(KMSG_DUMP_OOPS); } -- 2.39.2