Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2358118lqz; Tue, 2 Apr 2024 15:16:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWypkpikMBgUGDT5MKIk5/I7slSg4AqL5KoQ1y+Sfcx/AiXNIVhW7DZlUteSwnevU6xrMhMjtnSbbOX2CTs9SlI/4HkskLl+ufii2Qh7Q== X-Google-Smtp-Source: AGHT+IF+ljFQACNB+llbNSDSEEyx0rFCDIAmBwBC4rkRLj84hD64LRf652i9H63tpgYKPmS/hAPZ X-Received: by 2002:a9d:7754:0:b0:6e6:6ea1:9820 with SMTP id t20-20020a9d7754000000b006e66ea19820mr14192758otl.14.1712096178820; Tue, 02 Apr 2024 15:16:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712096178; cv=pass; d=google.com; s=arc-20160816; b=pICAQARlVOx2I3xTJJ+I32vetHPOb4TaaEMupcrIULl3VHTNWLYOvNKwT5oK6UgZeS 6rEUcbtYEvZsTnazbitAbFVsEUhPxi6Lbut5IggoZ7PshvAEiL/fWkaRm6JU70oXmDii 0yr7pdja2c4Wf6/JkT33LmhCfQuKXKqfXGCY5qOB+KTZd3hNy4mSYA7iTH9H5O/Ye0uk I8gJYr+ILjqIhsqnjomxCC0CVc9TfLuLLGgIV9GmByUc9oI34MYsDor9znXvtMDhaSK5 OkcDzZbBxj/Uy0s/fE0JSlwjjsNf4U7d8Zy9rvtRjL+tUlCBfxwdA58jRuvY4oLJ+kZq LKSQ== 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=aWb2ejOVxlZ3v7+K9dsSM3w74v6x9Bx6kvybMFlfTXc=; fh=YXV6xsCtQQsR3rskLCmLCA9gP8c827N3Um0fq0gsIeU=; b=s8qj6/XVO7sEI2FlaeKvqkkHtj+AltgwotzcccoMZ0JTH3PIILqRPCMcpjxH9Dz58M zQVtpkPGqA5adRUQg0qfR6yVWS8SBpbMK2fZ2bRiP6Jo5fICEE2zRVmON872pkTozX6W aog12v257edkjMEuai8SW8xEjx7RZnAVbudpJPTBFPCN9Kxj8otb+6MX7uOO/0MKQMWE HnoF0z1zNBgQBlFcw2lWane/QQC7O3cH7j02QxMpfPy7/fntPnN9XQ5rikh69Jdxnc+B y9f9apEKwTyPCd3c/CNEY5xYYvNF6QiYYzhDeYxglwMIHi1G/HU32FnJCpT37k6fd84W eMgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NXYykXZ3; 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-128784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128784-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. [147.75.199.223]) by mx.google.com with ESMTPS id s4-20020ad45004000000b006992714aa16si74000qvo.50.2024.04.02.15.16.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 15:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NXYykXZ3; 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-128784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128784-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 8770A1C21D7F for ; Tue, 2 Apr 2024 22:16:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E981716A1F4; Tue, 2 Apr 2024 22:11:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NXYykXZ3"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="E8ZXF0KY" 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 8A42E161B53 for ; Tue, 2 Apr 2024 22:11:49 +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=1712095911; cv=none; b=Hdmy0iQP1HfSzqbxtdvVkgfY50HEj9ZOwMnKrlhtuJWF/ldoAASdKy5gicwFqu7+Lgaf0lj0PPbUU8dQnJ5IL93tiUv9Kmv3tvZVj3rW+WuPHi47akjua+8Sh8VqiD7sCFR7jXoSkROskmgYjwVdJavBor+2YbZfnprtbc7w6Eg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712095911; c=relaxed/simple; bh=AEn1kMCZQRezyf2WMmaayQEC4zAM6aF9ELGCLd+z7bI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nIfocT9qEQ0iJ++TsgGXrOjR5pgvnSe5twqwW9kdj06CmU0YiT/tfh1h3MPQ7sjC7ROyelE82pe2LSc7i8t+veQLQ/IOWk6wWwNqweF4zY6D0OMDAldal4/aoJ6s/gtfZWt+zHwZ1RcWHk9syM/ff1+hOxfkArN8TxYlwbn+in8= 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=NXYykXZ3; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=E8ZXF0KY; 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=1712095908; 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=aWb2ejOVxlZ3v7+K9dsSM3w74v6x9Bx6kvybMFlfTXc=; b=NXYykXZ3wBR6jVDDnE7QmpKfTlFvQ68QfjHGjE6pMty5wKbhJe1ClSymgkx+CMPs8old1Q +He78mUJwd2g+gvwAjKgiLfIZpaMbcUBQVTJkK9ijQkx6fl4OVf5S8zDdhZcOkumJlrW1j sUKo5O4sewMFCZP3unD9knwNbgppiqBqdABKCUqVZ+NuZ7CzyRrEVzKNCK1ccRsrTOsnoc DlW0qw39tFfAV5Yw0W9uElxIdsZsM3g+8B+2QSJ/lj8tzbQPz3FfAUSLeGmQHAGpguibNT z1SJt/Ux4Z4qQ/t4i/ZsrDE6F36tm8RHkSm2Ial4bTgFU51TqowYy2DpJn61rw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712095908; 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=aWb2ejOVxlZ3v7+K9dsSM3w74v6x9Bx6kvybMFlfTXc=; b=E8ZXF0KYj3Y3uxpQRkkUOfwub2nPQKvnrOk3dEgZKOEekOxHQQYCl7782XAoSRAHN8+P6/ alre4vb83o68ARDQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Josh Poimboeuf , "Peter Zijlstra (Intel)" , Uros Bizjak , Kefeng Wang , Lukas Wunner , Arnd Bergmann Subject: [PATCH printk v4 24/27] panic: Mark emergency section in warn Date: Wed, 3 Apr 2024 00:17:26 +0206 Message-Id: <20240402221129.2613843-25-john.ogness@linutronix.de> In-Reply-To: <20240402221129.2613843-1-john.ogness@linutronix.de> References: <20240402221129.2613843-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) --- 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