Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1429267lqm; Thu, 2 May 2024 14:50:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWv/AhEaOD57PxxLLwzC5DcOAnX8uINO2lBJ+9YXV9FU4N+v0AwVlsvXT/M/eHFiy3/Kk/QkjgGnAKrc/4zcS3pJZWBpV8ejAZh8kuneQ== X-Google-Smtp-Source: AGHT+IGmoMVyx/qvBUutqsydNsZzEIKgTpaYhJYeJXGND0zoU1WIA8v0pBteLH9KGaBwYyY6Aom/ X-Received: by 2002:a05:6358:7f1d:b0:186:f45:391a with SMTP id p29-20020a0563587f1d00b001860f45391amr994124rwn.28.1714686644173; Thu, 02 May 2024 14:50:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714686644; cv=pass; d=google.com; s=arc-20160816; b=ug8RTGN2HR39LwGyWXM7m9ho/mJu7oH6Nf7vIwuoIGyJfCynAKXTTWfYxVkK2j6u53 1DNyyTZgjVLdKBDhlmCMjY2Dmhpye6Oqcm6RfAW/Gc3XRrsha5CN0XoGWiNusq9a/a1k 6FOWcDqYNhbctE0Cc3bwl1nTI6iXxhqnGu7uHmU8kvifkn9ymVd1lUqaXO8qifIVVOvF WxYzKHS6aKxezqWH8HOnXfIGuvpXq3Qa2Bw7lQxFmyTJDn/ledJRe4oWiB8JXMFayY02 souyILQ+6l3PBcRcKL37o1b5NEy4S3+KoXZdImsAOHkpABYhehZKsMydOeLpMHEMF3Re EW2Q== 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=02mlGKrKUI3gQEB07A6y9zFTpJYkffg7XWV4RkY45mg=; fh=cn/LHNkUINeVHZIXHVr8oG8IqpDrKb2U4LVX9+AHVoM=; b=U8RHVf4lnbjoc4reZf3q+vMA882CwOUtRTZPBmvWMy+F/uXENs6g6+WtqIHLLxcwWm X1xefvrH4fokOXMQ2jWty4m/4IiUE0tRvT9JJJyoQ6hvPjeI2IiBop61HxFVYXCzDCqY JXKR9NaTUp6z3iAZcbcck1Pca553sC9F81MO9bRM8c8PHA4r4cVCQ8zffH5EL7U+ZIQ9 4sPv+FLcNlo7IomGxAwSRrefech9a5Lx9kYG6znpnGtwWHXQY3ZI4psC+ophgryhEXl7 z7fUvTsQXc064sr1MIYjNvhhQ8gRM6bzpnjuZmrOpC5z8gBGOuJixI/FXw2s5m0CXG6o vhxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=a26noFQ9; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="UB4dx3u/"; 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-166977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166977-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a10-20020a631a0a000000b005d81ba6649esi1720753pga.891.2024.05.02.14.50.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:50:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=a26noFQ9; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="UB4dx3u/"; 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-166977-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166977-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A598528C9FA for ; Thu, 2 May 2024 21:43:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E0A020FAA9; Thu, 2 May 2024 21:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="a26noFQ9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UB4dx3u/" 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 4A1A01CB334 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=S0m5lfC0qFKU/r4TCtMqFSziJvdb6Vk2AltgrBpOe+XG0K29kOfQyGRLzXt15ZISiPFc9KNDVj2iNItUSwSRLNU8SE0lMoM3BaJqUwjyZGD2rI9nZyhRR+X3dqFFDXSAAI/328oatDq6BzMkEbc5/I8qbYjyGFi1Ekmq5vSDLio= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714685938; c=relaxed/simple; bh=sIDwBVtEZ9II9z34FVW/arDvGAYqJE9qC2xSXnoiiY8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cD8SKoqkbIA5PxtWnl1BU/kQHl2QvhfSVH1BRkDvnVxZbPP8bawyhoAsMfzmr5IhyXcxrP8PKYOEm4VgVDrR4v2eV0/ldMGrAW248ouaQ/9AfozWFhdbtvLgGPHEAO4blTS13qAors3Gl3La5EfPNthWP/OexCoP/57vD7WeaOs= 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=a26noFQ9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UB4dx3u/; 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=1714685934; 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=02mlGKrKUI3gQEB07A6y9zFTpJYkffg7XWV4RkY45mg=; b=a26noFQ9VHSBNGAz/Zf3ay3EJNiHrzvKdrHmERLizb1irxGUdVyR/YY3YMueIhuoxFqKQ0 IJHSjYGaYGOA4XUYSeOumtVWycJKnO7KWQx8LubIxcab8aqXO96D3pUMa0ImyDAf/pbWkN P8yNWOEXNM8GXK3UjEZR1y9ssUhH3SloV4UGq/415wm5ONyYmqpqRUByR96+U7ZNpK8mxv G+VVivHdhVgaqIN/0Uq8aKwx5euxEedx96o39X+12B7IHtD9xAl3p6Agmxkz15Q538JFsp /Q55TQ0HjwTDD7pnKaXbuFAeib1YEAyvPwYWPQu6cLz66ExorQWqNKrZv0D+lw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714685934; 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=02mlGKrKUI3gQEB07A6y9zFTpJYkffg7XWV4RkY45mg=; b=UB4dx3u/PO58OnwfwIPQI/9jr+UCmR8vKb2hurmxCwEkii5uFJJLOtxgRyVLRv7rLnXcaI JZotGhzCIm1HLOBQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Kefeng Wang , Uros Bizjak , Lukas Wunner , Arnd Bergmann Subject: [PATCH printk v5 27/30] panic: Mark emergency section in warn Date: Thu, 2 May 2024 23:44:36 +0206 Message-Id: <20240502213839.376636-28-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 From: Thomas Gleixner Mark the full contents of __warn() as an emergency section. 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. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Reviewed-by: Petr Mladek --- kernel/panic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c index de8115c829cf..ee03193f9495 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -667,6 +667,8 @@ struct warn_args { void __warn(const char *file, int line, void *caller, unsigned taint, struct pt_regs *regs, struct warn_args *args) { + nbcon_cpu_emergency_enter(); + disable_trace_on_warning(); if (file) @@ -697,6 +699,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint, /* Just a warning, don't kill lockdep. */ add_taint(taint, LOCKDEP_STILL_OK); + + nbcon_cpu_emergency_exit(); } #ifdef CONFIG_BUG -- 2.39.2