Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7097201rdb; Wed, 3 Jan 2024 04:45:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGT+fPX/CtfG+R9nTw2cSVPPMiNGRZRe0eXuudKTbbUVp33Hp5meKS0oP1m7/7UhDlnl/5A X-Received: by 2002:a05:6a00:390c:b0:6d9:f3b6:c588 with SMTP id fh12-20020a056a00390c00b006d9f3b6c588mr6652357pfb.59.1704285932696; Wed, 03 Jan 2024 04:45:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704285932; cv=none; d=google.com; s=arc-20160816; b=wKiyvCkL7aCGTwIrRVlQhJ57TrgBQ98Khu1bfOFSkqmBjgv3SSS0u6vchTSz2WnfNW WHS/KxlW94EJJP7F2wtvEDJZKuVTNAoj9OAfJ6IKsOQ8Xv+h7wiuy+K2x647f8imLtaC SFMxFKKuMOgEmHgSkV1NOvpKEY0dSep2D5lN+SS/F04CgCDUyy3p9fNrSA36EpJhU63x rLhUIbXSobRi/qyooNIPjUxNdvyiM5NIX+nhQlGMqZcvPg7Kn/CCLQKj3X6xWCTeJvqq V3alfquIPGmL+fPwanxN6th+N96o3XqSywHE32oKxc5HSIfTJPAc81T7NcZBf2ELkjNs PcSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=1uQTJsDlXqN3pzqpyIsK1JU1Pq7UhaRv03G2ZeBqzD0=; fh=xSRPqVmCRbueWIxZbL00TgeYQCNNe+tDCiEQNTT2gTE=; b=j1nzML2oYms6LqhPtWyy+hd405vNL9D3OQosYcgjFzNlWZB6FhLgPRuC3+pv2kJtvi LH9p4nczGvFJ9kKlqb6hhjiNX/8WZFCak4vGKhtmhYyHJ+uN01eEuMR0e/hoOsrCz3Av iudeAZ7o61mG9zXomWFwlN1soC1YzMo1fdwRE37XbQNgqAGT3SDDxBFjK3AWgedfNJfL tAcsvXYw8NkTEg5qhfFoRBBJGZ3QouFgF2qSwVPokLuOBED6uDmMGYT9VLBltnqgPCrM kq5tu4ZIbNTU6FWNzpHUYwV4/B2A//HgCos05w4z9tU04ImwugU9OlKxzava+6jb+XKw /KDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A2aNVlUA; spf=pass (google.com: domain of linux-kernel+bounces-15527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ay20-20020a056a00301400b006d9b31a5243si16331924pfb.350.2024.01.03.04.45.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 04:45:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=A2aNVlUA; spf=pass (google.com: domain of linux-kernel+bounces-15527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C3059B23724 for ; Wed, 3 Jan 2024 12:44:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92A3A199DA; Wed, 3 Jan 2024 12:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A2aNVlUA" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F606199CF for ; Wed, 3 Jan 2024 12:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-50ea9db9e12so53396e87.0 for ; Wed, 03 Jan 2024 04:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704285851; x=1704890651; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1uQTJsDlXqN3pzqpyIsK1JU1Pq7UhaRv03G2ZeBqzD0=; b=A2aNVlUA9B+9lu69CXV81TRW57OQ2RKsTGyS47LWG2A1B6MHRFPuhjXJ5O/0Cw45Tl vRA5aPDPxNiQNw9z9QPHc3v7ieV8KovI74hq7thyDb9qZOxm6pRApqdxV+KsevqG2Iez VChUOzl60m6QyUtrf2qpf7WHELEOVXnlk23be1mo6QUCzvahi4JPKf7iXtUQMe5IEsIY wETWkCcgllpOf28fYUeThUUzgxI6oVrrN6uugtoHk5Ltx2Wcf6X/snoPTGTzcLuzwE64 nefs+reQpt/eQkpZ/KuX6rJkddOUNABNbf6pnWvJtHMokJyOyi2CFYjMutqSMVQQDYJS nAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704285851; x=1704890651; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1uQTJsDlXqN3pzqpyIsK1JU1Pq7UhaRv03G2ZeBqzD0=; b=jyaIzr5M9DI8c3a86mOBwdBbAPkkcKt4jQuSf5JyTkLZwh/rqIh4vigK+6XbAHHQNo sUHWu7xvWcXB6xoHs1O13r5u/DKX6Oc919/GTyCT9iboZffkGRBKD97cbItWTo6qZsuY 5huDB9tplhwMbarAnvLsQgbguas/ZETLbbGyQoeoLe/lf8ps1dJbYOUVSfYSaHhJ3RcR Nb590MTndk5lzv1zVGDqQLaSoAA8K8PzZSuFsgWJ4sWYkhc4goxoCs4YBF0lxiVodCf7 LCsVOJBolHBRTzT3inHRXxxklbdoDNaLTo3Hh8otSFJPZxrPre+XQZqs2RFO0aifeJlP SCmQ== X-Gm-Message-State: AOJu0YypubtzoQnwk0axiNDHLbNuemKzQYkCBoYSSVeenmK0Q1gYmLOP PLeICrOaoZaVStiN5SnUyCmx4IpGy447OFt9EG4= X-Received: by 2002:ac2:5105:0:b0:50e:70b0:6eac with SMTP id q5-20020ac25105000000b0050e70b06eacmr6288331lfb.121.1704285850844; Wed, 03 Jan 2024 04:44:10 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240102074351.1528009-1-alexs@kernel.org> In-Reply-To: <20240102074351.1528009-1-alexs@kernel.org> From: Alex Shi Date: Wed, 3 Jan 2024 20:43:34 +0800 Message-ID: Subject: Re: [PATCH] x86/dumpstack: uniform die messages To: alexs@kernel.org Cc: Josh Poimboeuf , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 2, 2024 at 3:42=E2=80=AFPM wrote: > > 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. Sorry for the typo, s/preempt/prompt/, And any comments are appreciated! > > 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 *re= gs, 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 =3D ""; > @@ -405,8 +407,8 @@ static void __die_header(const char *str, struct pt_r= egs *regs, long err) > pr =3D IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " = PREEMPT"; > > printk(KERN_DEFAULT > - "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_co= unter, > - pr, > + DIE_PREEMPT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xff= ff, > + ++die_counter, pr, > IS_ENABLED(CONFIG_SMP) ? " SMP" : "", > debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", > IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "", > -- > 2.43.0 >