Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp611216imm; Wed, 26 Sep 2018 04:11:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV62kT0GI4SaUobh3lLwgmX7nli4LVsA/WIwkAJZPJZ/rvDEdBffp8z/Vt/GbnxOLfwoRFSsZ X-Received: by 2002:a62:6f43:: with SMTP id k64-v6mr5640060pfc.87.1537960317525; Wed, 26 Sep 2018 04:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537960317; cv=none; d=google.com; s=arc-20160816; b=rrxH/uYRGnlwU9R5Utqf9xaMEPTrxi/y+B3PTlXg8GLGPmDtnb45eiFUw6cqxIx/9z datOy7//Hid/K1hjPttsezEgCQpK3QmHRSf97GjyE5dzfQn1PY5N0227h2FoZKtpiNZo sDQJT95XQqs+YQc9swPUH9D0Lhwm6H/lOYBhBTObFPh3XgxZm4QIsPYRuo+3Bfzqxesh Ef2qEnt6NnCJvRImKpCzd6gwoia4I7f5Z1C0SFxFVK3vUL7LfhHVXVQdFpBhiE0GRJRe VmUCOjVxicaVgrlMwpPg0iev1Xb18HUweXn4FBBkEaGyS7HK99A0dc9xiR5uGXYt3UZb vf4A== 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:dkim-signature; bh=UFoZ3c8H8D8HojkBTGUdAOuoezIBtfeEHIZr07uMF7w=; b=lwY56fW7cCe5PGphFb1EW+xk5TWyQLL0UsMJxnuRTxE35rx7y+zaZXuHkk42AccrAo UrjPLgsIjwnQh8Mjjqih7krgtEbpNbuPQEQF/3lKnTjGWO1L6VVzPl+ie1eE0nHFhDLl gebjci6wWDKsDtKHZrmFnIJ4nHkQMiv9aUER6SsPT7+6RRgmLx2h3RwyGddN3zpUCYs5 9IggfquupLHv2gFg0kE3KPQt2IFG/FPHM8t36yzyEt3kSly/9bjEGzLq5cW0XqxMgr4n 5mSqXPGGj0vHeT6oFPhI/IZD8Wz7nCGN/yflcVxDmaHGmIPTNJ/mseZCuDaooDSTDBof 0jdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WvKfSVtO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3-v6si4660695pgv.652.2018.09.26.04.11.42; Wed, 26 Sep 2018 04:11:57 -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; dkim=pass header.i=@linaro.org header.s=google header.b=WvKfSVtO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727667AbeIZRXh (ORCPT + 99 others); Wed, 26 Sep 2018 13:23:37 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:50232 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbeIZRXg (ORCPT ); Wed, 26 Sep 2018 13:23:36 -0400 Received: by mail-wm1-f68.google.com with SMTP id s12-v6so1841015wmc.0 for ; Wed, 26 Sep 2018 04:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UFoZ3c8H8D8HojkBTGUdAOuoezIBtfeEHIZr07uMF7w=; b=WvKfSVtOhWkl/iY7V1PURUIb3WWl5XuEfJM2tVy6ONaOPdGiyt/mH+H90Jbe2Jllmf X1Sr03Ayeaf2sY+zP8GawlE9X2dG0Li+j0Kmg6XJfhvgsolz/ZtT84AZSVNQOkKMLRnl 0vgLE7mq1hrZFHbVma7X/r8iataoPBO1gE+Xo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UFoZ3c8H8D8HojkBTGUdAOuoezIBtfeEHIZr07uMF7w=; b=g+2ZVp0flGSZbsjk+JgI4s+Hu46lsYSodv1MmHtYLLAbZq+v7wnPFFfq3t/N5GZkjJ cUSWH2otNKKPuyzP+9u/E9HAMOwnzw/iULI2FoKohpHSXYaPUzp6ntm/vEw+TCT16c80 djqoElLDrf/ebs7zzUhSaFtZ47+lhViGEwUSURS/pc3XHcjt5+QtSNgk/+L52J2zcFRD emcvtZ7ACPdV6TXhSWo1QfHnSlzPuF2T94wV44WH+auu1HUD+E0+AhPI3WfKuziJS/E9 AY0EA69GpKmMxfmOhMAh9F1munXVRIPOVi9mGMxbLz+ZQXEIvLWKJVnI6L6Q68PspE6f ctkw== X-Gm-Message-State: ABuFfohgK9UqXJZ2yRC0LH7QaxQ9ZkGkYVJcD9oh9wTs461ydyjorb4/ p8R8TdNZ47AU6utDaU2EZHIfzg== X-Received: by 2002:a1c:e5cf:: with SMTP id c198-v6mr3949245wmh.113.1537960268746; Wed, 26 Sep 2018 04:11:08 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.googlemail.com with ESMTPSA id k63-v6sm8549559wmd.46.2018.09.26.04.11.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Sep 2018 04:11:07 -0700 (PDT) Subject: Re: Re: [PATCH] kdb: use correct pointer when 'btc' calls 'btt' To: Christophe Leroy 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> From: Daniel Thompson Message-ID: <5f0e0241-b7ab-b5fa-de0e-01abdbc85770@linaro.org> Date: Wed, 26 Sep 2018 12:11:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180916190610.vzqxwps7zqy2zc6o@holly.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 >>