From patchwork Tue Jan 2 07:43:51 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: 184271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp4315695dyb; Mon, 1 Jan 2024 23:42:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmKesQlnVxDe+AhtxskGvypLggaoQ+zZ52e+iQSAiBo1sMvzN7OHLhirIS/yBgIddo3arM X-Received: by 2002:a05:6870:a70a:b0:204:5b42:ed23 with SMTP id g10-20020a056870a70a00b002045b42ed23mr14996836oam.70.1704181361791; Mon, 01 Jan 2024 23:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704181361; cv=none; d=google.com; s=arc-20160816; b=oGiKmutYkG6G+YrlNHCdCeNJg3RPqJvLdsej0Ykf+J1rOQ9oJxho0pMr24wWEMFG1k HRhsCmTrq6y5Og5fP3Q/iXZHewmwWkxy4klQZwVJ/Za8AksUEA358RdoUF+jGj/Lk9m4 dqca0dVwi6DPsHZnGoc1e8RiW5Bvnn/YNY4F1pAuAI7CKDqpbKCwdZCiptFz0GkdXOd5 RHvp2pGX1b8Gq4TdeFdskGNRjfMaUCTLG/GTOKByeU9D0V5jCqr4uxxeNSJwWcJhjFsJ 0siTlUYcHvUr2hpa7qPtjqtB7Hrt4ZpREInEZVm22w+HQQOGQVWTu/rjb3JzHP5S+ri8 kNdw== ARC-Message-Signature: i=1; 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=LKT51dXfUBRUcBfxoiMQT9JmH7Pqc1X0wEy4ain0lvQ=; fh=BCVTBa70uGDfM4X7kFoPSRbn9sYaMwOjUxEYLdCm8vg=; b=sps7kb4lttYuWEubDPfP0iQoT4kUHv75nzJO7m9PDXP1cbBY6sRH/AGgBFBFzv6rRi MCsRiBpsysfZXT9FqM2jT2Zb70dAH8DisuxVRevn89scvxSRYx5q6OuqzgklYcXPAVwf 5gN1WDJ5f57vRLm2upksGBm74WXfApU2zgdtUuZG/u0/UUIrahS3IqGJdgfU8CGRB5Td X5Hrqv0cjVy3SOBldwhePLyObLfUWFhauNqrzvmaSvC42eNEOoTkoem+lUt5ozas9/mJ pmUnLmWydRmjsIrA7ZM2fAhLWtZiiirWaqORzzxzG5/knvNkIMps2wEvT++Hkow4ol5X md6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XBq6Mytl; spf=pass (google.com: domain of linux-kernel+bounces-14120-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14120-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i7-20020a6551c7000000b005ce0a03ccf5si14374761pgq.536.2024.01.01.23.42.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 23:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14120-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=XBq6Mytl; spf=pass (google.com: domain of linux-kernel+bounces-14120-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14120-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 8BF9128226D for ; Tue, 2 Jan 2024 07:42:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66FB346A0; Tue, 2 Jan 2024 07:42:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XBq6Mytl" X-Original-To: linux-kernel@vger.kernel.org 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 C71AA20F8 for ; Tue, 2 Jan 2024 07:42:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAF3BC433C7; Tue, 2 Jan 2024 07:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704181346; bh=9DEKpBAK4lAfxEl+HK6SsacI9TfcOy6SmxwkqN+ethw=; h=From:To:Cc:Subject:Date:From; b=XBq6Mytlngor+fYXTiV7tYQE4gmlfDid3wxgABGQbLv0zLFeV8oJTRHL8O+5mXOuw LoTN/f41GPhDAXSe0519oqjz/7peMuXp9TAJTX3f7Rsu98R5+Ili6VCIP/UhjxDExD xCY8M+8R0nb5h9NpjozNpPaMDlQEiFQuso6gYJz4Nkxt2+yRj+ky0gvZt32vYyORld 3GJFQGrvisapwp+8HjcwQDynGZ5gfl3kmVyLbYua1uqgY0EshNg6A5wD5Wigau12tE JYwOaKh44tILNw0UpUGALIrN1X8tzRIxreiLqYJK8HKoTgex3tpnWl2nPtmfXc3CL1 9mERgdw4uRDLw== From: alexs@kernel.org To: Josh Poimboeuf , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org Cc: Alex Shi Subject: [PATCH] x86/dumpstack: uniform die messages Date: Tue, 2 Jan 2024 15:43:51 +0800 Message-ID: <20240102074351.1528009-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: 1786963675535797488 X-GMAIL-MSGID: 1786963675535797488 From: Alex Shi panic() has a uniform preempt, like "Kernel panic - not syncing:". But die() doesn't have. We died thousands machine with very different reasons. With current die messages in dmesg, it's hard to write scripts to collect and anaylis the die reasons. So we'd better give die() a uniform preempt to make the life of system administrators a bit 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..00766e7ac077 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_PREEMPT "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_PREEMPT "%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" : "",