Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3200355pxf; Sun, 28 Mar 2021 16:14:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDzfwMn/jNmW2fy2g11JvTOKcVQs0Za8pgYX5GNJWjwx5Km97mM1hGTw3JhOag8r1RauIB X-Received: by 2002:a05:6402:549:: with SMTP id i9mr26752820edx.379.1616973293909; Sun, 28 Mar 2021 16:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616973293; cv=none; d=google.com; s=arc-20160816; b=xgJnr0a7RnLG44dGlvw8VUYIGAs/zYaTHcq4Gq+WYSe8RhL8Bd+VtMO+OQiQGHC/u6 uoSm25Rzg0q1aeoU4TNNpcTlq2lJNgFBvoDaF0ajxLeOk+qVTwykEfFNl2pkFS4cxGmp 68ykqtz+KynLsjBIMymqXZpsjPtVouJ6TuCGGU6Vw5KS4oB1ZKafAF/VwUAfGN9A/27u VZea4+EjFyDeKoywA8LX9rACix7eq1Ryd9zSeTzjUQ8D85FLSxO5TvO6Yv7Lb+CiABaI UL7t/TyIV+KI4o0ue0ToVVdEZLn36h9RF0R6AfaQyW+jhTv6yuMKahYuLTBzM3AdEVK1 ZG0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=F+acd+wAtwxDeIH3a/XI8b+galC2ktSCYvgePmLFg0o=; b=dguVhEsFsM/xubJ3vo+SV2CrqxfnWL2JD1PvIttpOFTKOL6autgW+EOshZbIplVUKP DWyAJBpyPkF3o9ryQuNkAUY79YrDNB4+r2LPXCV0EPhACMxONK/iapyG34lfW3ZfV6Kk 6r4Dt6WYhjH/50j309CAsVJH+DP3U+pV9ATxZ+T6kfqzpFpV3tIc72WVwF4hQ+h7ENc8 JPPFGEUkF+qq7hfmerT6Y+ikMBO+X0R5kR3Kt+zmmZnpuwKXvruULHUBv2e3jxwqYR66 xrJb17ugPMCkLKOTXmoNp7RaVRUuxOTzX9KaXKU56Wd6xFu6a+e+ic6iUj6MNNf7OQfy yCVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@me.com header.s=1a1hai header.b=oqrm5Avb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=me.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si11596459eji.719.2021.03.28.16.14.31; Sun, 28 Mar 2021 16:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@me.com header.s=1a1hai header.b=oqrm5Avb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=me.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbhC1XLi (ORCPT + 99 others); Sun, 28 Mar 2021 19:11:38 -0400 Received: from pv50p00im-ztbu10021601.me.com ([17.58.6.57]:46908 "EHLO pv50p00im-ztbu10021601.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231424AbhC1XLh (ORCPT ); Sun, 28 Mar 2021 19:11:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1616973096; bh=F+acd+wAtwxDeIH3a/XI8b+galC2ktSCYvgePmLFg0o=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=oqrm5AvbsdX312NT8NpR5RU2cYzzJv6BJNTgIA7sVLSRr1XG9v50I9uhv5X/g55sz AO+/tbShntRQmm/6Z/UTRNIZyTea4kh+Td1Tb77HgPfltjSbFD965CoxvRhpARRAJN qPBuiNurVRZ8IEG4XhY19PDDJdCCDHT8qkcxjl2LO0ZFyLmGugxclSgAsYo3s4zhdP XWRB78DQ3OBwkN5IsMKcC3duYT7hlEdl0oTlDF2ZpJqg54eY1cIKFc3FmeonkEwoT4 WYS3KIDaenewPQrESyltZA4SMS8DftUsCrFyXkaGOsLFxLdJ/vw+HTOk8bRxgo7tX0 GiRYxvwPE2Tdg== Received: from 192.168.1.5 (unknown [120.245.2.89]) by pv50p00im-ztbu10021601.me.com (Postfix) with ESMTPSA id C8A9E6E025D; Sun, 28 Mar 2021 23:11:32 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [PATCH] powerpc/process: Enhance readability for trap types. From: Xiongwei Song In-Reply-To: <8de71b45-efea-b493-ee90-b89062e8e30f@csgroup.eu> Date: Mon, 29 Mar 2021 07:11:29 +0800 Cc: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, ravi.bangoria@linux.ibm.com, mikey@neuling.org, aneesh.kumar@linux.ibm.com, haren@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Xiongwei Song Content-Transfer-Encoding: quoted-printable Message-Id: <9C228D50-4378-4477-857A-D34D46BDEF5D@me.com> References: <20210328143545.24324-1-sxwjean@me.com> <8de71b45-efea-b493-ee90-b89062e8e30f@csgroup.eu> To: Christophe Leroy X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-28_13:2021-03-26,2021-03-28 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2103280179 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 28, 2021, at 11:21 PM, Christophe Leroy = wrote: >=20 >=20 >=20 > Le 28/03/2021 =C3=A0 16:35, Xiongwei Song a =C3=A9crit : >> From: Xiongwei Song >> Define macros to enhance the code readability on ppc trap types. >=20 > Good idea >=20 >> Signed-off-by: Xiongwei Song >> --- >> arch/powerpc/kernel/process.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> diff --git a/arch/powerpc/kernel/process.c = b/arch/powerpc/kernel/process.c >> index 3231c2df9e26..3bbd3cf353a7 100644 >> --- a/arch/powerpc/kernel/process.c >> +++ b/arch/powerpc/kernel/process.c >> @@ -1451,6 +1451,10 @@ static void print_msr_bits(unsigned long val) >> #define LAST_VOLATILE 12 >> #endif >> +#define TRAP_MC 0x200 /* Machine Check */ >=20 > I think usually we use MCE, so TRAP_MCE would be better Ok. >=20 >> +#define TRAP_DSI 0x300 /* DSI exception */ >> +#define TRAP_AM 0x600 /* Alignment exception */ >=20 > Don't know what AM means. TRAP_ALIGN would be more explicit. No Problem. >=20 >> + >=20 > The defines should go in a header file, for instance asm/ptrace.h in = order to be re-used in other files. Agree. >=20 > You should do more. You can find other places to improve with: >=20 > git grep "trap =3D=3D" arch/powerpc/ > git grep "TRAP(regs) =3D=3D" arch/powerpc/ Just ran =E2=80=9Cgit grep=E2=80=9D, looks like the work is much bigger = than what I imagined. >=20 >> static void __show_regs(struct pt_regs *regs) >> { >> int i, trap; >> @@ -1465,7 +1469,7 @@ static void __show_regs(struct pt_regs *regs) >> trap =3D TRAP(regs); >> if (!trap_is_syscall(regs) && cpu_has_feature(CPU_FTR_CFAR)) >> pr_cont("CFAR: "REG" ", regs->orig_gpr3); >> - if (trap =3D=3D 0x200 || trap =3D=3D 0x300 || trap =3D=3D 0x600) = { >> + if (trap =3D=3D TRAP_MC || trap =3D=3D TRAP_DSI || trap =3D=3D = TRAP_AM) { >> if (IS_ENABLED(CONFIG_4xx) || IS_ENABLED(CONFIG_BOOKE)) >> pr_cont("DEAR: "REG" ESR: "REG" ", regs->dar, = regs->dsisr); >> else Thanks for the response. I will send v2. Regards, Xiongwei=