Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp620636imm; Wed, 26 Sep 2018 04:20:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV61q6iGk5gRRt//FyiA6IA0PbvjfQlrVv1Kad+Sf90SzvVnnnTMCBkQnt3DootnK/orv2yy7 X-Received: by 2002:a17:902:784a:: with SMTP id e10-v6mr5616875pln.197.1537960813402; Wed, 26 Sep 2018 04:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537960813; cv=none; d=google.com; s=arc-20160816; b=RcuoNXgv1DjPszeBj5+zvmel0ET+NfqUNl//nC0YimRPMFwDS9BO6nYIivZ/oLpGQ6 dsXadfMb4mov7LlMAG8QdtR0l5SyuWQaRj/JM8/2GrOY5rfh1GoLO3nCnKftnAUsEWws Zg5PSYCQj4BHhJOhJA6+k+Z+qo7V1kwawu92bt20tbpFDbyB2MWRynmbHtxDi4w59i/i IcJ/uyu1YW5BXX4sfJuQGNwJOdz2tEhhTdrtasfCao9BE02JQPRxay87oxWpqzMZAmoy mXF9DcT6kJyv81VXe4nAh4K8Mo5LOfBSnMdMLhjmRuqNbVz9r2He2d5LPVIf2VrlK1rN McVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5o31EhVlQzqSqqeFopgLgpUQx6/Jnn/1qScGy+e11X8=; b=v/8SBOUUtet63OFevQTK8V3Gu7XHVk278a5I+E3O4B4sNYIEDQzYDnCZDFNlCQ0pDz Beg+lbz55Lz8AYWwfPQrdPrj4NAYN7N3Wk0FI+8AYL1bKTDG6LNxYVGeOJRpweWKzBKV sdF3WO18B44YwY3hgrhaEFBdxsFtPpJIebvNia9cKoQV7XFbbjCZVgPSDMoTHTqeZI/2 SbcXT+4HU0kzAAC+Y9rmz2ZhS05nNPNXv1+7fmxD4xDhhx6nYoC81t3vg5XPiqphausO 969XmHJf4X4Cp7GWEF7cU1cA1jo5U1GRZO+jrSjAd4xibkwTdKZDpxqxZPt+yX5SiUkB ndow== 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 n1-v6si4557853pfd.50.2018.09.26.04.19.58; Wed, 26 Sep 2018 04:20:13 -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 S1727698AbeIZRbw (ORCPT + 99 others); Wed, 26 Sep 2018 13:31:52 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:42176 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbeIZRbw (ORCPT ); Wed, 26 Sep 2018 13:31:52 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42KwSS0DmXz9ttFk; Wed, 26 Sep 2018 13:19:20 +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 j2nLRa-gITL0; Wed, 26 Sep 2018 13:19:19 +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 42KwSR6ZjLz9ttCH; Wed, 26 Sep 2018 13:19:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 114268B80B; Wed, 26 Sep 2018 13:19:20 +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 xJQKDjtdK-1a; Wed, 26 Sep 2018 13:19:19 +0200 (CEST) Received: from PO15451 (unknown [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A57258B80A; Wed, 26 Sep 2018 13:19:19 +0200 (CEST) Subject: Re: [PATCH] kdb: use correct pointer when 'btc' calls 'btt' To: Daniel Thompson Cc: Jason Wessel , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kgdb-bugreport@lists.sourceforge.net, stable@vger.kernel.org, me@tobin.cc References: <20180916190610.vzqxwps7zqy2zc6o@holly.lan> <5f0e0241-b7ab-b5fa-de0e-01abdbc85770@linaro.org> From: Christophe LEROY Message-ID: <760ed3ff-43d9-75e5-b36c-aaa7871ffe50@c-s.fr> Date: Wed, 26 Sep 2018 13:19:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5f0e0241-b7ab-b5fa-de0e-01abdbc85770@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 26/09/2018 à 13:11, Daniel Thompson a écrit : > On 16/09/2018 20:06, Daniel Thompson wrote: >> On Fri, Sep 14, 2018 at 12:35:44PM +0000, Christophe Leroy wrote: >>> 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+ >> >> Would a Fixes: be better here? >> Fixes: ad67b74d2469d9b82 ("printk: hash addresses printed with %p") > > Christophe, When you add the Fixes: could you also add my > > Reviewed-by: Daniel Thompson Ok, thanks for the review, but do I have to do anything really ? The Fixes: and now your Reviewed-by: appear automatically in patchwork (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=65715), so I believe they'll be automatically included when Jason or someone else takes the patch, no ? Christophe > > > Thanks. > > >> >> No blame attached to Tobin, but the fixes makes it super clear what >> changed and why this breaks kdb (which was not explicitly called out >> the patch description). >> >> >> Daniel. >> >>> --- >>>   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 >>>