Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1877229lqb; Sun, 26 May 2024 23:42:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUc6HRrJm0fQxFNfZGDxmNIfUKVtnN1zgR5I0ZV5d0w86xmYID/nwMF1Gv+fhIew0Ea3x7AAUCKh6ICIYdyxL6CNQ1bg5abHTffC/0gQ== X-Google-Smtp-Source: AGHT+IFr4imAJAbC27r9QLOlETizNmTejlhvtBZHWEBEz4gIyFl/mKpKn3+NNeUBt23fxfOEzuNz X-Received: by 2002:a05:6808:1510:b0:3c3:de8e:5411 with SMTP id 5614622812f47-3d1a7646fb3mr11506038b6e.38.1716792135581; Sun, 26 May 2024 23:42:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716792135; cv=pass; d=google.com; s=arc-20160816; b=NyzN8kdOisrYlzFqcrFAg44N49lv0JwIdTUfPLU7shFftjpXGNsRKp5gW0QKN+++Rf HcmsqdCn28pfEbpdOwHSo8eW5vquc8uNzcXpHblxl/zEg8mDZ4kMrV33jsIb2BLH/CKN e0efWrbHQt0ahjCbGHZeMafKWKwTGxU9F47A1itvW7SezJm8E7lyMO/+XI9rHgFamk8W 62pBatWWNv7vjrn0GW16zilQYS8nid78PC1WSDbsrCbjIwH9aE+Hu7aHR0tfWmb3KVBB z+pLQHaq3mcw2te4sPD8AUQycnGSQCGQP2/Y5R/t/gLPRuuFZtqXcFlhiqgr7g44vaxV tg8Q== 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=B+K/9iYBz0qN2LGKfIR8RmV7r131ocMZXQdULGkVxU8=; b=l2iqGschZCT1OxvpBfTeazzbWLj1fx5noPHx3nA6AIrT7EztBfJYQerexWAIlZCGpU kbKI8h1DcRFYYR8UfJAo+l+xOvwj5zzQZYb9Swn8Aovpqh/yV4lV/M5ThTP/VHy16SAQ pW3Bg2lrjWntjgY+PzFV8nxI6JBgc3qjnfsx97f6k2ycGuWHpqt1GU1/CyeSuSQf2jZ6 /JVO+t89EDGrjljLlPDhIEFUuuU9Tt91pWxPAZp5lDO3EHvdIENJ5uvWDUmhqZgNKGfm MEt2cNAxYT0Bo0Lb2D2QdOzCOBG8PH20khQX750EPgs3oSwwkFLKJwBA4xT/e5bXkZir HvYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aYKL3EDM; 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-190099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190099-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 d75a77b69052e-43fb18b3e2bsi75518711cf.529.2024.05.26.23.42.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 23:42:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190099-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=aYKL3EDM; 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-190099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190099-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 4E07C1C20B8F for ; Mon, 27 May 2024 06:42:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAAB013C3F9; 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="aYKL3EDM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DoZ/Rjz/" 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 B9C4313A890 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=bEXLiC6n6Yuw9IXFwLyAi+SSFshpdAJOGVVCxkXwnFC6USWbDLk01+UuPf1ytofXE135baL0OCUSuiY5vNow6qshpki+wdK9pv1XVC/gQo29lu0OS31vfeziPLzbVDcIAOABOy4jSbzHc4chlp150fMvUzeFk+IsB5/PZot6cQ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716791910; c=relaxed/simple; bh=sIDwBVtEZ9II9z34FVW/arDvGAYqJE9qC2xSXnoiiY8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SNHojcFJHH18EWfVvMN2COeK1DJ1aU+Fl6/mqMRILfDKAysSSjw7T3JeOeJHX0VS4VkETGh6OD4zd0f5sHub8hMyFsik59fM2Rk4BweNiSiuuRkM97RPmJ+BeiKv4RtfjJpmRNZzgUJkrqKtxBhwdP6dj7fHVV+7MHey1XKkrvc= 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=aYKL3EDM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DoZ/Rjz/; 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=02mlGKrKUI3gQEB07A6y9zFTpJYkffg7XWV4RkY45mg=; b=aYKL3EDMXfEN5u/BkUloG96mutWZq+ZZ3GeBeND/InbJGzc5EnHbsePE/NpwThihtR6Vhg puXFNVoM0uOPbwIfHvqs1ebeGgAqdw3VXdJWbBvQu4mpWqUZBg/d2tdnQmp2wfSgJcp2jZ NjYDP6n6gg9s9TvsxVBcStU0AZ1dZ7kJ+pKz1h/wUmzThq5VLmQLyaorznGhZaKDHhyVNe iq/Kbs6sC4YZsWOjXtW/GhQ9mGzCkC3Qd0wCHIIxPkuzrm1zqjvW9ouu/FWC88PMgW4txo H3OBJW7ehFmb9jaEcgF1m0AEjBwBPgVTS3zhu7Ds6SwiIA/SmEpwqxNqdmSjRw== 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=02mlGKrKUI3gQEB07A6y9zFTpJYkffg7XWV4RkY45mg=; b=DoZ/Rjz/SfznAeRULibeob0mkM4fpJHPWg3TxM8CdhkJ8PfklVRabiYNlhirPCEGqarBwn 9ywtzurOjt4ZM3AQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Arnd Bergmann , Lukas Wunner , Uros Bizjak , Kefeng Wang Subject: [PATCH printk v6 27/30] panic: Mark emergency section in warn Date: Mon, 27 May 2024 08:43:46 +0206 Message-Id: <20240527063749.391035-28-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 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