From patchwork Fri Feb 2 07:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 195674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp268059dyc; Thu, 1 Feb 2024 23:44:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt5ezhfClJbr35AkvH7CUn9mePaF42B0ez+E0bx54O6WeCUDZOHBYl7cOe847VZ8/kHcuq X-Received: by 2002:a05:6870:330e:b0:218:edd0:439b with SMTP id x14-20020a056870330e00b00218edd0439bmr4318688oae.28.1706859847615; Thu, 01 Feb 2024 23:44:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706859847; cv=pass; d=google.com; s=arc-20160816; b=WunOlM2etEinE/UGOUpqDZUTspP3WayAJoezrNVlyVarSHB4w705fGjcVtmCoGn/yx X+cXDIyM3tjfhMoVrnzT9zIRtnZDjWTf8yUrobiuwN60MXCHog0TgCc9nBXNwTsdy+98 A+qhM7c9zrYhHUKbAnYg2Ir3bac5WEH/cCWMcN+B7dFmsmxZUkT2ZXIMZaLZJpFrF721 QG0aV0EHm2LjPLBBkrJrxvYpzIujHGyVQ3D3Z+WETO9+AHfOYCNFuT6f5ZH84qF5Js0x 1DdW++2VjF78PvDorQ/UmcEGY+7P7OtdNR6M6JFctcun3yFRySu91MGs4Yd0Jh5qUndp RkTw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=jW21hrJzVigm8PRMD00EbrD/zK7nTtYwwh0p9XuDjAI=; fh=Ky3PlCUI13OQwcuQDwnfRbdW1Oir436JSTyjwwG+jPU=; b=GA+C2QS6ekDs1bj+S0xYF/FuR/JMRFQS2ac+1ZXBxZw0x8kCTRl5rpSJmoEwC/ylhf 5VPn0lc/3wzZgAw/2MRhGJpNT0gWzClOzcbSfpI3TWAQJ+pZIvfA6rRFjxyJc4xUSYxI au6NqqyTRotjBqci5+cdVuMHrnkPIA9+8+KZmKrY1vMLJWpXLRDTUAOPvfW58+G1D6uY GdSxcC8vwasiKmRRRO1K7mgen0vXmakslDLkyDGm8IQ8SgEZup9PLJE6GPEFFcQ7opFY TDw1tojWhjITwR6ZiLZGV+TyZNd5mWGMMThR4IRrRGCIY9kumg93y2DPXI0320JcTB4z EgGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HpyrYF+4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49377-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXIn9nIkd4q3MnoDiILL8/2yj7gLMM8IEKG5jH1BM9grW3pCicFp2tLMTRT16b4Iu7ZaBa1ItDzkP+spdt9UyTBm1uU+Q== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x8-20020a63aa48000000b005d8c55c031dsi1159930pgo.345.2024.02.01.23.44.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 23:44:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49377-ouuuleilei=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=@kernel.org header.s=k20201202 header.b=HpyrYF+4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49377-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 7B6C4286F94 for ; Fri, 2 Feb 2024 07:42:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B4D6182AB; Fri, 2 Feb 2024 07:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HpyrYF+4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A666B18028 for ; Fri, 2 Feb 2024 07:42:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706859730; cv=none; b=MyZodHEUnSDSklmq5Lq9MHTyg1zSjHkTgPU5FtSJMd9uI0MF6GrFQ9u5A6Px8reGNP94DZM9eTSsuZTvB6l+JeO3MluMs/WQCbRxW0WuL3G2MbjuoMCWZynoHmG1PMCSF++YTkvkN//AAIfXwRF5N+MY8Aidv039+H4PjaBDa7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706859730; c=relaxed/simple; bh=TFYyKtNU9LrtUbdDfZDtr2Ce6cbj0SCWcK3+Yb6QTxQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ldWppIackfrtOTkBC7SaB/rGvvO2PmSMInpHbSC+TWuj3k/ORMPXqMI63nfa931PUTHn0H5AIlALCX8OmUESr8MHC0zVaRQNDWQTwmqzLq50uYnBE+QW1IhG2ugZaARsgVHGXeyiDbQJPAPaanl8kJdLWsGgLwrqME3Y5u9D1dw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HpyrYF+4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1D1AC433B1; Fri, 2 Feb 2024 07:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706859730; bh=TFYyKtNU9LrtUbdDfZDtr2Ce6cbj0SCWcK3+Yb6QTxQ=; h=From:To:Cc:Subject:Date:From; b=HpyrYF+4ooyhYEQuqTPHttDXPZeAJe2Jk5R32AMWODY7PhEo70DDcALFEzqcIKWmT 100AD5h3kIYTlfkj0yi5pcoNK3rQIbQl1Uy5FFVLj5xR7VbTSmaMliUJx6R6tho54h ToNl0hxePM1xGUBWjdNwk+dIii0Eel14++EEirmxcGFq0QRE202zvogLo/vsiBDNPw WhHbTfeNqo7lm3PjkY9WQTbtvHPQOfQIH+m7z5oNWWLJsLKMTn6S6zhZe5wml1wCwn qsUT5/6+h7GmGVCBB2mTCiRiEe7jGpzCUXVQaYRbIidT+l6Z7n8f9dO2ccyENmC7sI 9SOSdde89o3BA== From: alexs@kernel.org To: Josh Poimboeuf , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org Cc: Alex Shi Subject: [PATCH v2] x86/dumpstack: uniform die messages prompt Date: Fri, 2 Feb 2024 15:45:12 +0800 Message-ID: <20240202074512.563274-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789772271454977958 X-GMAIL-MSGID: 1789772271454977958 From: Alex Shi panic() has a uniform prompt, like "Kernel panic - not syncing:". That's easy to indicate a panic there. But die() message doesn't have. We died thousands machine with very different reasons weekly. w/o a prompt in dmesg, it's hard to write scripts to collect and anaylis the die reasons. That makes admins' life pretty hard. A uniform die() prompt could make the life of system administrators far more easier. Signed-off-by: Alex Shi To: linux-kernel@vger.kernel.org To: "H. Peter Anvin" To: x86@kernel.org To: Dave Hansen To: Borislav Petkov To: Ingo Molnar To: Thomas Gleixner To: Peter Zijlstra To: Josh Poimboeuf --- arch/x86/kernel/dumpstack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index f18ca44c904b..e9ad413d21f8 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -393,6 +393,8 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr) } NOKPROBE_SYMBOL(oops_end); +#define DIE_PROMPT "DIE:\n" + static void __die_header(const char *str, struct pt_regs *regs, long err) { const char *pr = ""; @@ -405,8 +407,8 @@ static void __die_header(const char *str, struct pt_regs *regs, long err) pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; printk(KERN_DEFAULT - "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter, - pr, + DIE_PROMPT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, + ++die_counter, pr, IS_ENABLED(CONFIG_SMP) ? " SMP" : "", debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "",