Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp730878imm; Fri, 14 Sep 2018 05:36:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdagG4TWo4yrGR0HOsQJu0SERWRtIF3bBXKYoJvvuddgzwuhlwzsEp5ULt4FGFVRSktlTwx+ X-Received: by 2002:a63:2043:: with SMTP id r3-v6mr11663663pgm.105.1536928570588; Fri, 14 Sep 2018 05:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536928570; cv=none; d=google.com; s=arc-20160816; b=wa1bg8VvgA1yiza2QWYppBB8pK29iuWPZiiTmK1gOhJYfwC3kg/kYiPEDR32e9LeQb oKmsY8VQDEh7Ndm8Mgq3YXcZH6uaHQnrD/6ogLGmNQRO23On80yqM/EAGmFF0bGbh5jF gOgbVgXhSFGjMQVwmyoN72mAsiZMMovp7GlB7bRiREp80q+wK85E7T52inUg6OL7dofd 4u7iFs+qYt32RABomt8nmo6rsW8jqrBCheXcGFlPTgTTYFx2Plye1VhWieUZ59r7LGlv QIqIFSa4wCGqPLQTQekED4anDBY+MxYCtJwr+pQvGf/ZBOhpRYdFlbw+3k06x/DJedps YtKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=Ram1YUEWbhBpnM4ST0sjYpKaAHIoLyOwjig8QIZwrD8=; b=jCIIr2q4Np+hYcq7DJU+Q+/vtu9Qu54QKxJgTY2MJb80GGBuBH0JTXfeb//2cEX7X0 vQPiIjb/M1BqUR1AjyaZEfGHffcb4kb6qg+Cn0QYYtmmphQjn2hssarWE+W8Y64v8P17 ebWPjReD0uyaI5bEYU5xrQlEBamT1u+R8Barp+r3CHniSMtu5U1iP7u3vTxbo+fHKchW +HlzSh1/uLjwFsyI0X6SBxJJqaEnSPM4PFZxjry+IrT6Y4cwpjYmbC3OCS36+vyUD4kM pOJvhP+oDsKViXDxQ2VC0h5JNqWFCGUvy4DiaP2GIQbdqYMosz/bNh4ewTgBgEy4pN1d YW2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si6968504pgd.400.2018.09.14.05.35.53; Fri, 14 Sep 2018 05:36:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbeINRuE (ORCPT + 99 others); Fri, 14 Sep 2018 13:50:04 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:19343 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727803AbeINRuE (ORCPT ); Fri, 14 Sep 2018 13:50:04 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42BZk50C2Zz9ttgN; Fri, 14 Sep 2018 14:35:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id b-sd0dd7qyXy; Fri, 14 Sep 2018 14:35:40 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42BZk46jDxz9ttgK; Fri, 14 Sep 2018 14:35:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 174FC8B8BE; Fri, 14 Sep 2018 14:35:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id kneS0n2lw0Pg; Fri, 14 Sep 2018 14:35:45 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D2F8C8B8BC; Fri, 14 Sep 2018 14:35:44 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A8DF1718F8; Fri, 14 Sep 2018 12:35:44 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] kdb: use correct pointer when 'btc' calls 'btt' To: Jason Wessel , Daniel Thompson Cc: Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kgdb-bugreport@lists.sourceforge.net, stable@vger.kernel.org Date: Fri, 14 Sep 2018 12:35:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On a powerpc 8xx, 'btc' fails as follows: Entering kdb (current=0x(ptrval), pid 282) due to Keyboard Entry kdb> btc btc: cpu status: Currently on cpu 0 Available cpus: 0 kdb_getarea: Bad address 0x0 when booting the kernel with 'debug_boot_weak_hash', it fails as well Entering kdb (current=0xba99ad80, pid 284) due to Keyboard Entry kdb> btc btc: cpu status: Currently on cpu 0 Available cpus: 0 kdb_getarea: Bad address 0xba99ad80 On other platforms, Oopses have been observed too, see https://github.com/linuxppc/linux/issues/139 This is due to btc calling 'btt' with %p pointer as an argument. This patch replaces %p by %px to get the real pointer value as expected by 'btt' Signed-off-by: Christophe Leroy Cc: # 4.15+ --- kernel/debug/kdb/kdb_bt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c index 6ad4a9fcbd6f..7921ae4fca8d 100644 --- a/kernel/debug/kdb/kdb_bt.c +++ b/kernel/debug/kdb/kdb_bt.c @@ -179,14 +179,14 @@ kdb_bt(int argc, const char **argv) kdb_printf("no process for cpu %ld\n", cpu); return 0; } - sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu)); + sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); kdb_parse(buf); return 0; } kdb_printf("btc: cpu status: "); kdb_parse("cpu\n"); for_each_online_cpu(cpu) { - sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu)); + sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); kdb_parse(buf); touch_nmi_watchdog(); } -- 2.13.3