From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64E5EC433ED for ; Wed, 21 Apr 2021 08:31:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 344AE613D3 for ; Wed, 21 Apr 2021 08:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235286AbhDUIcL convert rfc822-to-8bit (ORCPT ); Wed, 21 Apr 2021 04:32:11 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:25643 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235219AbhDUIcJ (ORCPT ); Wed, 21 Apr 2021 04:32:09 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-10-g07RpUZBPa6J7oZEm98CFQ-1; Wed, 21 Apr 2021 09:31:33 +0100 X-MC-Unique: g07RpUZBPa6J7oZEm98CFQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 21 Apr 2021 09:31:32 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Wed, 21 Apr 2021 09:31:32 +0100 From: David Laight To: "'Matthew Wilcox (Oracle)'" , Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Kees Cook , Marc Zyngier , Vincenzo Frascino CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] arm64: Show three registers per line Thread-Topic: [PATCH] arm64: Show three registers per line Thread-Index: AQHXNgoYyzkcKOScw0mUJJFkt/fGqaq+o1Zw Date: Wed, 21 Apr 2021 08:31:32 +0000 Message-ID: References: <20210420172245.3679077-1-willy@infradead.org> In-Reply-To: <20210420172245.3679077-1-willy@infradead.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox > Sent: 20 April 2021 18:23 > > Displaying two registers per line takes 15 lines. That improves to just > 10 lines if we display three registers per line, which reduces the amount > of information lost when oopses are cut off. It stays within 80 columns > and matches x86-64. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > arch/arm64/kernel/process.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > index 6e60aa3b5ea9..aff5a2c12297 100644 > --- a/arch/arm64/kernel/process.c > +++ b/arch/arm64/kernel/process.c > @@ -294,13 +294,10 @@ void __show_regs(struct pt_regs *regs) > i = top_reg; > > while (i >= 0) { > - printk("x%-2d: %016llx ", i, regs->regs[i]); > - i--; > + printk("x%-2d: %016llx", i, regs->regs[i]); > > - if (i % 2 == 0) { > - pr_cont("x%-2d: %016llx ", i, regs->regs[i]); > - i--; > - } > + while (i-- % 3) > + pr_cont(" x%-2d: %016llx", i, regs->regs[i]); > > pr_cont("\n"); > } I think I'd avoid pr_cont() to avoid 'mishaps' during concurrent oops. This probably needs something like: for (; i >= 0; i -= 3) { switch (i) { case 0: printk("x%-2d: %016llx\n", i, regs->regs[i]); break; case 1: printk("x%-2d: %016llx x%-2d: %016llx\n", i, regs->regs[i], i - 1, regs->regs[i - 1]); break; default: printk("x%-2d: %016llx x%-2d: %016llx x%-2d: %016llx\n", i, regs->regs[i], i - 1, regs->regs[i - 1], i - 2, regs->regs[i - 2]); continue; } break; } David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E74D1C433B4 for ; Wed, 21 Apr 2021 08:34:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55A5B613D3 for ; Wed, 21 Apr 2021 08:34:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55A5B613D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=crWg+jjSrh1O2B92OmDyXwg3a4/20Vv1goifdAeMJcE=; b=Wd0ENPoqGHFEsLSeCtX2Uyn9N YcGvW/GEF07vivLE+6CWEW7HINcMDlpqu/Iyx8/NEVOVCm0XmpMLS72ty44idgZv6WLFELQUQqXRX OfQzykjfDJCuXPtq2gZpOMzdc6eoe7a+wsvttlfrgTxfTTazI7imcgDLuXknC8xmPRAc90LVbLyH7 Skt3LiRLbjm/HiGwBA+qCsN3mq+2ojfKAKQKiRnnD1SMR8Z1cX1WIcvkKfAhI/hxFoFwMjd/BH3kU anGM+ZewCVwDfhNlFaS0r2p9YWMG19ps4wFIDiRDnSOy4JzCewxYvMRGfyapp0o76dq69DF/MCKhI AyL3n4oPg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZ8H2-00DydR-Pi; Wed, 21 Apr 2021 08:31:52 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZ8H1-00DydH-3M for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 08:31:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:In-Reply-To:References:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=duWRk9a99+mpefzkPp5ScM0EhXN7Y0nDEN9GgaN1Gkc=; b=f13IPlDWT3mqr7L3jBrB9lJkt1 Dk713lb4egjT1lnh6wedT2T2n1ouI1sM3CixgpKuCibO4KhFrlxzpliXNuQlRmmqtcotzRnwxY17/ is+rY7/fvIZvqX/033h9KCWJyRJGkTfUvX+Flo+8JaD3TB2qyfDHKZ69wRABRcsGxvuSzNLpONatu FT1TamxC8iNjpiIbd0L+VzeMYfzntVxk1NnvyoRLVl4PknnQyvXaz7ceCU3Kl9C4C38nv0txqoCRq ta/ICNTaLUB41rnayRVVDe7LxSFx1FkpXPRBhV/GKR1EYQsQzHTOTKMv0lFVrhbq4Q/fsfKd9forp Hhy1ku3A==; Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZ8Gs-00Ci6W-5h for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 08:31:49 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-10-g07RpUZBPa6J7oZEm98CFQ-1; Wed, 21 Apr 2021 09:31:33 +0100 X-MC-Unique: g07RpUZBPa6J7oZEm98CFQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 21 Apr 2021 09:31:32 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Wed, 21 Apr 2021 09:31:32 +0100 From: David Laight To: "'Matthew Wilcox (Oracle)'" , Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Kees Cook , Marc Zyngier , Vincenzo Frascino CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] arm64: Show three registers per line Thread-Topic: [PATCH] arm64: Show three registers per line Thread-Index: AQHXNgoYyzkcKOScw0mUJJFkt/fGqaq+o1Zw Date: Wed, 21 Apr 2021 08:31:32 +0000 Message-ID: References: <20210420172245.3679077-1-willy@infradead.org> In-Reply-To: <20210420172245.3679077-1-willy@infradead.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210421_013142_494180_16F62FCA X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Matthew Wilcox > Sent: 20 April 2021 18:23 > > Displaying two registers per line takes 15 lines. That improves to just > 10 lines if we display three registers per line, which reduces the amount > of information lost when oopses are cut off. It stays within 80 columns > and matches x86-64. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > arch/arm64/kernel/process.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > index 6e60aa3b5ea9..aff5a2c12297 100644 > --- a/arch/arm64/kernel/process.c > +++ b/arch/arm64/kernel/process.c > @@ -294,13 +294,10 @@ void __show_regs(struct pt_regs *regs) > i = top_reg; > > while (i >= 0) { > - printk("x%-2d: %016llx ", i, regs->regs[i]); > - i--; > + printk("x%-2d: %016llx", i, regs->regs[i]); > > - if (i % 2 == 0) { > - pr_cont("x%-2d: %016llx ", i, regs->regs[i]); > - i--; > - } > + while (i-- % 3) > + pr_cont(" x%-2d: %016llx", i, regs->regs[i]); > > pr_cont("\n"); > } I think I'd avoid pr_cont() to avoid 'mishaps' during concurrent oops. This probably needs something like: for (; i >= 0; i -= 3) { switch (i) { case 0: printk("x%-2d: %016llx\n", i, regs->regs[i]); break; case 1: printk("x%-2d: %016llx x%-2d: %016llx\n", i, regs->regs[i], i - 1, regs->regs[i - 1]); break; default: printk("x%-2d: %016llx x%-2d: %016llx x%-2d: %016llx\n", i, regs->regs[i], i - 1, regs->regs[i - 1], i - 2, regs->regs[i - 2]); continue; } break; } David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel