Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2358245lqz; Tue, 2 Apr 2024 15:16:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWiZgisqwyuGqMwO9LC2lfxN+lpbvzjbwY8mNMileGHN8wLSlwSUK608LQu1MHUbMdkeKnqkbWU5BYp6wtBjjiHhbmU975UYkW/3OVaxA== X-Google-Smtp-Source: AGHT+IGPf0YRIINUmYE9JuzAnrJq4pObj7bKuFbQVUgH+qtnosVxS4i+pjw3RRPSjTVqMNcxCZBv X-Received: by 2002:a05:6358:4716:b0:183:de5c:77ad with SMTP id j22-20020a056358471600b00183de5c77admr1075403rwn.20.1712096200909; Tue, 02 Apr 2024 15:16:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712096200; cv=pass; d=google.com; s=arc-20160816; b=n/sLXtnOAjEOpINI2HOzqft0KtdczWsh0U9mkBrtpWdrWK7FKTv13BA5ga/5ruCDiy PzK3w4q3oMNRr0idt/xFDrKhbxbFOU/6SX06kIjHUR26O3meRdqwUkCd/u026usaWsx+ M11CJpOMbdgTIAT7X43oU8RRvWsaV2DT+6cPeQEcrMmRPHsJlzYviCGh7ZctaWVg/DeB +z9e18SJ/PPrK7YQHSNbF1JNRKIRHoLl+JifBlhrtWLH5YC3CEzeflsruXUMayNRZ4oJ aV1Z4Qd9ueVbQ8RSyrdV16a8WvERxDarangdL31GdCj2SQvxRRJzfuwtVcHpDsVogmhg /XQg== 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=kRn0di1HIXp5SiW2VwTfWrnEOjP1EiU0PA9D4LBG0KY=; fh=yDYVlNfVLrPa3FSQ974A1afWjokGN6vHhxhLowQGpLk=; b=gJGUSv5FfANiGS55gPh89OQ5/EokXInfZBweqIkTIJRKgKjCTFKDmUWX8WvgvdPkyZ X5bDCpBYftad0+4MPE22y8c0jBWKT5Yt6Dyq/XuuNYicu93AuCCeka1hQ0xEJA/ptMQT Vn5XYIeX1eheePeDlPKvjRaP4o06lqJobD1GJ+IOoUuq4xc8+2+6jJiEcV9SwoAsurMd PTalHdTTJrNuA0aIaEY4rz6Oa+X2XSy0mOtT2v6lHEK7RK0fisjWhLaTS575RtxZc4S3 X9Co2UcwsLNJGSDc8noJ6PHmd3c8TtmI6WwBV66q5ry03of8fKGseL3n0tWmqhvh5ET4 +kgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=jEUQYJPU; 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-128785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128785-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 de38-20020a05620a372600b00788422088f0si14713786qkb.615.2024.04.02.15.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 15:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128785-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=jEUQYJPU; 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-128785-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128785-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 749651C228D9 for ; Tue, 2 Apr 2024 22:16:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C83216A9A2; Tue, 2 Apr 2024 22:11:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jEUQYJPU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8UYn3jmD" 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 DB9E516A1C5 for ; Tue, 2 Apr 2024 22:11:50 +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=1712095912; cv=none; b=bP+UkWFZOjq9+FGXEhcASudnVExqG3Ap0koR/g20CpgFcz3q3XdugU5vPHCnoxk1ONNAM6ylyo++I6TWWYJetS7nJ0kIynAx+PTpiudvhDxjR3Y733u1O0yHsyY/1BYkhra6YrqRS2H/Aeya+fkLqTqEZiykYL0VWpE4WvE1n4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712095912; c=relaxed/simple; bh=c6akV9Q4yr/rVYenMeX346mAEuxD5wte66aQQO78Ys4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FDnggPWLFPNACVCD90QsjsZlhZQPDul+rkHWDdlVWG1+Z/9PnhCiIxaQLEPcKVkp4KKpxibIBdpSfg6W8Wa4AMWDtpOwVshbrXR9908ZGufhHos1P8g6V8QSfrSFa5iRrAqOKYxv7i9GZMVmU/V8zX8aQ5N/pY+/Ra2I68fppys= 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=jEUQYJPU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8UYn3jmD; 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=kRn0di1HIXp5SiW2VwTfWrnEOjP1EiU0PA9D4LBG0KY=; b=jEUQYJPUMBBAm3IA0xtFogfZYqN8W6tk7xUNjjINI11G289jXRJUfyFKHWIKN6MR0k3jUk chUu61nuVRMycoinG+POGGDHbT+Du+0H4G7cHJfJhOKhHyVq9ETm4wVvcxeFM5lGJLIbqu MO9cNkOVpeWzHpS+gFgYb7vZhbAerUSJBna/pETFTuLBMoUJg2C+XYPmU7qr75br10XZZa uK9Y5W+KeqcsoINaRAyAI9FR2pnMH1lNuXPMXQ8m0M4QD99O1yBkP9vu57rRKrFDRUqSFL FRWCKjEnBp5xHVHUge5um1GmTTJwLR7FxKFJRdWHSX43IrdjgzRbtWl5MyKDDA== 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=kRn0di1HIXp5SiW2VwTfWrnEOjP1EiU0PA9D4LBG0KY=; b=8UYn3jmDJCT+vLtiD+HIuun0WTy8GnE/FgLQA8pHn/0RkeFSKs9TW1kQpbpyPxGskCjZQV qLOR3bfzO9aCTWCw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , "Peter Zijlstra (Intel)" , Josh Poimboeuf , Uros Bizjak , Kefeng Wang , Arnd Bergmann Subject: [PATCH printk v4 25/27] panic: Mark emergency section in oops Date: Wed, 3 Apr 2024 00:17:27 +0206 Message-Id: <20240402221129.2613843-26-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 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 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