Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp773159rdb; Sun, 18 Feb 2024 11:01:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWjGDKf7LLs0WDZ7W0Ga8CzMyqUVy7wIhacFP+hSnMpn00x7jcPfE8VwQsO3xPxYKcpCo+bUEoQXMMfyA4PmKu6ZMGA3JwjpxbA/ztFOQ== X-Google-Smtp-Source: AGHT+IEh19g6v5fKTcNA/P7lvxhxbc5OqnSwiK/gcQNljionJdsNGRSVr+rGwIHWbrWrHiVjL7xf X-Received: by 2002:a05:620a:2408:b0:787:5582:2a4b with SMTP id d8-20020a05620a240800b0078755822a4bmr5454121qkn.45.1708282880515; Sun, 18 Feb 2024 11:01:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708282880; cv=pass; d=google.com; s=arc-20160816; b=ZsophbFY3cgkxbfULXU2fFwVxN79Z/CZHuT+vtHe6rDfujNSwv/it33TYGb5s3Tgl8 VWgrP/RhvwiK+77+VO+q5gyAAmAkXZvdwVgYFBJyBSa6mRR2LaEnFmEqx7F4bUv7hXVt E5mb9kdGwkqB4Q9WD5NzVHDJ4TvM8+nHsbtuNp6JjUPjtspsDpDHSY8jxuAD7LDmdaac WJqeicGnbHsvJO50wGOA1+bmIEIyPn8kV7wjYAKhSyzqUQuqUEkW66oGaf4SdU0RLDFW kTSeug9hWD6iRTDfYLp8UCpAVSlIcmsfL4KMyC4tdN6LEDCfzBN+2g216/eCg+R7iypd hh/Q== 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=vuY4H6DNfOvqdhuJgmJkGITg1xVtZYUjr6s1BV/VGVM=; fh=AqkoYHEBm5sznhcIUwO8PhD1+RF2lHOeWSnt73YGpuY=; b=sqznE+dX6wTjj+GI0gyPgbxOWMdmOkOwHZ+FgzDouWlWg/K1IAUeJCgpHR3vLSzLhJ nyy+LGBXclvn448Nnx9wd2jU+O1mn7lU95MpW606aFHOnIwcGMwB3urjEvDN1XIX9s+u BZ635q4+M6wKlfkrJsv9MfozpNVFwdpp3Hc8H3BMY10Iya2brxTKhIld+K/GgU0otdyc mqB+eFY4EyHV5YPGpkFP+x6YdIPRu1lUEJLqRxnQNsngDxvF7JbFny8tDVAJr+cRAqBS wU+SuHnVh8PrVzkGYrHueFppZ8UsvGHk4tJ8jnmdlaNMNk4ziXW9u7cHg7r65VloLB77 DDfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ctirOIaN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=RqqpxluB; 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-70517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70517-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 u8-20020a05620a454800b00785d6b12f46si5423743qkp.699.2024.02.18.11.01.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:01:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70517-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=ctirOIaN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=RqqpxluB; 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-70517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70517-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 0B0D01C20F6C for ; Sun, 18 Feb 2024 19:01:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C68B763E6; Sun, 18 Feb 2024 18:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ctirOIaN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RqqpxluB" 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 534B973198 for ; Sun, 18 Feb 2024 18:57:58 +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=1708282680; cv=none; b=FRfx2MhUkqDiKpd1FenA3lmhxgcxpSHOr6pmymypQNz1K531ATUuYHQI4fd3cZqekERkSNSmG6+yD0XnxaABv2x3V22oq/IyHUFZ3k5t0zU2CERFkO2AZOqqcnOQofpAoBTFwvnw1szfILnoKVtR8oAQFUfxqA/U5QADqiDArG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282680; c=relaxed/simple; bh=KzZOuY5lO3xJJiP/W1QN+WoXmg5dBEU4teyAhbH6PyM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QhGxNcUIbkS9OP1rqDZcWodK6ojIBKL0YCafEtygoppKL6NOT6yQaELhUzbhjWoIeq8yngbOZNeQgWo0x04U/opmwg/ABi3cABNKy9hgS+NWyNq4e6N1Ittjwf1I81PbIb4mJoytunPeK+iyuVDZ6aC8QmiXQjzy+/Qi2+G13tQ= 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=ctirOIaN; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RqqpxluB; 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=1708282676; 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=vuY4H6DNfOvqdhuJgmJkGITg1xVtZYUjr6s1BV/VGVM=; b=ctirOIaNRIvgvx3YlEoT7eH4LHmxuqM1FokSoyH0oWhdq5jTYW+lYL/44OKj6rsAY5RpHU frOqOjhxm1qw2g0xiZ155kVd/OxpvloShfzpNUx01Sk4PcAmjHDs5XFq5SY3zojwP44Niq kzuFFtUdhdYhkhJLWdxnh7H0aJNevyyCAHMDzAD1jkPltPwhfq/vDUtYAATl5c/c/QkGSh YhQOiylqDCC57M3b5lC4o3b+XocaT2fVAfMSuZLrpWxyx0vIeYKO/wyA9D9YvImqOK+KfG 4ygRkaJdPAqFfgSlKNV+NsklnZIxpcjlLBCaLg1NSY7N9DGFfkGz0zQmyiqZ5w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708282676; 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=vuY4H6DNfOvqdhuJgmJkGITg1xVtZYUjr6s1BV/VGVM=; b=RqqpxluB27iUY1upXjEPYku+xInDFnSzwmsETUKpBmIETtkeLCPFtzkFtxr0vooC1/lybD z01lu3AituTxVGBQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , "Peter Zijlstra (Intel)" , Josh Poimboeuf , "Guilherme G. Piccoli" , Arnd Bergmann , Kefeng Wang , Uros Bizjak Subject: [PATCH printk v2 24/26] panic: Mark emergency section in oops Date: Sun, 18 Feb 2024 20:03:24 +0106 Message-Id: <20240218185726.1994771-25-john.ogness@linutronix.de> In-Reply-To: <20240218185726.1994771-1-john.ogness@linutronix.de> References: <20240218185726.1994771-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 --- kernel/panic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c index d30d261f9246..9fa44bc38f46 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