Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1426504lqm; Thu, 2 May 2024 14:43:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3vRlLj8CgC6xp5JnZBiXBjVT551YaNkaR1aJ2DI3jU4KLoplPYgzU8lXlt9Cvruit1efJU1QAuA1lzk8Orua2oriG+6E4erUU+xEC7Q== X-Google-Smtp-Source: AGHT+IGejsDBV7mgOGr4Dur+LBlRtQq2dyyQaS96qM2QwQ48/assf7beY2B8V16W5+iS2/94Hvzb X-Received: by 2002:a17:907:9875:b0:a52:2441:277 with SMTP id ko21-20020a170907987500b00a5224410277mr395030ejc.66.1714686213068; Thu, 02 May 2024 14:43:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714686213; cv=pass; d=google.com; s=arc-20160816; b=ldc8LhdjXP9vbUExCiKwWUfn/DRAIYz8+jME9co1jtQNLAlhmoOjZ/b8o4kpfKRz+h 63w4UcG64axSq7Ys1gBh/eKuw6wxlFMTI89anhuKN96y4ssLHltxzQPBSrNVfLsQM9VS limdg6VZf+Ba1+N+rHYhIdL0vluV9+BVxwqFgZ+pRqMLjY0FkC6d+S/zg3/J/1scjXdg 4NzYGG8nq3qTwwCrH8PQgIOgkfNu8oO42pm1AtRtLcnMbD/Fi/bnxAdX5i+kAh4I3FHE EB+JyQehK2ilp2/L9m7Zy19/ityMbfMBNaNO347bEvSmqqlS4L4+NOn2vwGpKszrK0DK 6C6g== 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=XmYTsvJep+3n/kwj2WQNRDd8hkdAE9pQedkTVHXYIew=; b=v5NcxVz+Jd7q4voDLuOSM4HnPyARzRlWOVkyvTEVq/3ZHW1lWw6lO8wrebHJEG07qn k0W0ch0nPBtkcD70/S1pZPVfj3ztzC+JJZSoU0yEJP7W2t1WLehXleXNmZgTDk0YyUat /k2Hx+QbsAdlCAomToolPK7N5fAFsm/AzN+jgfScd8LfLXt4iwvBUQaqYqboNUXBfsKK 7a1V7wDjnZSbxP9Ru9w/o/TgdLO6wYYt4xu02Oqf9kunwHAHXsvWzUWg46G8TiNqBxed 3HCuRMj241JtZXYdm2U0O+GIQWLvo15lW7A06n7bE3z2ulMMdtiZEOQ+69e5IU0K43hK +wtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cXQO7XfS; 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-166979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hq11-20020a1709073f0b00b00a5873061113si878904ejc.508.2024.05.02.14.43.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cXQO7XfS; 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-166979-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166979-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BCDB31F2195D for ; Thu, 2 May 2024 21:43:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00580210197; Thu, 2 May 2024 21:39:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cXQO7XfS"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="n88rBhwC" 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 0EAAC200127 for ; Thu, 2 May 2024 21:38:56 +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=1714685938; cv=none; b=ZVwGegnv/giP43j14ZPxhGVErHKx57QUP928SIZpS+rzoUbCHmVZjIkritbh4TqY4TZN2Q/R9zP8U+mZKx4NUNgyXxK6bCasVmU0WnWS+u6uX0weBvNdp78Apxq2zzYl4dv80Q4DpaVMB1BzKAEms3wclHKaFBU7y+NPATXbQzU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714685938; c=relaxed/simple; bh=ApV3BrzIy3FzvWp+ns3WoghCqTJI0MOJzDStPgz0cJY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gUvxLGUuMOPDhf9zUNvL6NBoBAW+1J2fYrD1BIVOXu1AM5yoIk2ShWxfnJ+kSVEdbvvlOk3ri7oatIBiFkRTyNtzp4R6UWiFSISLsyzXbu+rvxF6KAtIVextN5ir1hL18l9JK1/uYpqkWQNLK8DxEdhW++CKg4rWHeatg+BaSes= 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=cXQO7XfS; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=n88rBhwC; 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=1714685935; 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=cXQO7XfSN9tVIahWJBnVRk9/NuzKFtYcODXtqO97f0RdomlvjPrGKpT64jFJn8d9oi+KzB +OsIlc71W61ovDYtJfBKxHBDLhFGENjN+VZz1mXE/ZnkfweudCF2tzHIpMkzscb3QjU30q 1YM2VVqn3bTq8FRZFxRigp6A1cI9oUo8kkr6IHaOsEP0ST449o91o/dArVNQYk+gb0hGzR Ou7X+VNxWz4KbEgwMwqNr4ejwRloq2IwPOu40t2TkcprKJgaUUMrjYSwMhDkILebpOwed8 pJ+4sfSj6y/MUNwhdiUyBT5z9Efg2loXf4LDfVM6ZNtwAdxkEs33uvWlnF3ZrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714685935; 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=n88rBhwCRrPVvc8GBpeigqEBKog+cA8zT/E2ErrYVLMiuFwxqQMV8NERGVIDDyHHRK/P4S WpKd5mkQtLalzxDg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Lukas Wunner , Uros Bizjak , Kefeng Wang , Arnd Bergmann Subject: [PATCH printk v5 28/30] panic: Mark emergency section in oops Date: Thu, 2 May 2024 23:44:37 +0206 Message-Id: <20240502213839.376636-29-john.ogness@linutronix.de> In-Reply-To: <20240502213839.376636-1-john.ogness@linutronix.de> References: <20240502213839.376636-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