Received: by 10.192.165.148 with SMTP id m20csp269450imm; Tue, 1 May 2018 23:11:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZprkSN0OpI3ka7MKvMGVRvjVXLvYqY7K6psCVXvWnIL8HXzTxe2g0gbJtAFfbgU5+POQCHu X-Received: by 10.98.210.134 with SMTP id c128mr18290609pfg.240.1525241490674; Tue, 01 May 2018 23:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525241490; cv=none; d=google.com; s=arc-20160816; b=d0Y/1UMrJ62uW9YhB5QRphLTsguUXzr0BTN4c8Nscz6XpXcMwRoLSwmX/9f/cBCfrn 5oaByk7yT7nBg8/5bNWrQKiyb+1OwxmWWFoZDexdzktEpP4iefemE47gaDqXOy6IIMoE bLGRPz9KA04rAo0UXnrB0JXc7W8+xt9IZEKV6tuFo/PuiIp3RkuPovC8vuR5V+gdy24a 5ZDOZRuuLmTsRbYxpEyWriO0/RXcbfRVRhHrvXIXxixAGWYhLYy6t9NmPmGb15fZsIRN xZvgHWUDgL/dECpjNG0ycXO8NobElV107aglat/+UHgeQUrPDzcgLlGshKZbfL6YvPq1 9KKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Nyg9l8Qn9OaFOnoASwyT1EkDO86IN5B51WxoVSTvMro=; b=vYrHA9S3knwFlSJe0pCCEHkGtA2id+Pz5WmLiBGGrqn4EN+TG19Y1ALUI0c/3dt77c xgcdFgOEXxavRWIe6YKmh5Fgpmcz1G03zSUV08lRg7O1gEFsZHwItufjgULgd8R1k61s QQWVXZOQ7f3HxZWx/kI5Rzp+PtO+ahNVejJabo6sorFPn8D8Y9MqiMpTqc4tjr9kl9Qf N5MQTquRCth80q1v56zu0gAqkOv06Vv4YT+/QcBJ+eOgQoGdIiWKvGMFsNwAWArh7u66 LadBP9VicyTpCS1/ts8sDbMmdGH80t6/+wWq8dS9kVB1k8NFhkl/S+FLnPv8zjs3hXPi pApg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JTJV5zaJ; 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 k11-v6si10474440pls.368.2018.05.01.23.11.16; Tue, 01 May 2018 23:11:30 -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=JTJV5zaJ; 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 S1751069AbeEBGKv (ORCPT + 99 others); Wed, 2 May 2018 02:10:51 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42343 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbeEBGKs (ORCPT ); Wed, 2 May 2018 02:10:48 -0400 Received: by mail-pg0-f67.google.com with SMTP id p9-v6so6946197pgc.9 for ; Tue, 01 May 2018 23:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Nyg9l8Qn9OaFOnoASwyT1EkDO86IN5B51WxoVSTvMro=; b=JTJV5zaJcIExJTlzuEjj4X+XWpkJ2pug9h7DbC6eTlDLakOmkpuA388eb6mJzqC6Vd /B6w5/d3QEbrMKrPkITVChUzJm1bU+JfdDXS/GJkCm2KlK0oUONLhCjZ+IaqV8KF9G5V IA+8RLtqzaQP2kzDVn4w13gUon/Auae454Lgw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Nyg9l8Qn9OaFOnoASwyT1EkDO86IN5B51WxoVSTvMro=; b=M3qavT9A65+LLOGlTr4zBcfIuGte4uX+OjtbEIQSWO1ninEAtPowarhRGI9N4EzJgE CUDFyhmcwXIx0PaBmYxdrz94lfChP453zRyeZ4xor+uDskzfn+k+IUoKxdNY6e37ToD2 S2fZvcQ3/O2pru/aQAFpCg0luWFlcwV/zHyZlezKkGurq2dak7z46GeAjG7TPWPPBt0t 1P8QjL+ftAcnx7olyPtqhEeuBR4qLdn/NKIzuJnw73wLZVkfXqv4/Jn9T4ZJqMbalNRT fsJYtGglDFbrXEr5eeOlyeo2ih2l+5iOk1FK/M65jRMrYRwX35FN2LSfRuPFlYQd3pf4 EMDA== X-Gm-Message-State: ALQs6tDZAMDyl3JmymDJM7JtcLKLsutBA0fsnuDDzpwMQsGx0qQK1gb9 j67o1moT5tgRYlLb6esUbu2RbQ== X-Received: by 2002:a17:902:7e05:: with SMTP id b5-v6mr18472957plm.230.1525241447493; Tue, 01 May 2018 23:10:47 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li1168-94.members.linode.com. [45.79.69.94]) by smtp.gmail.com with ESMTPSA id y24sm6344339pfn.23.2018.05.01.23.10.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 23:10:45 -0700 (PDT) Date: Wed, 2 May 2018 14:10:39 +0800 From: Leo Yan To: Kees Cook Cc: Mathieu Poirier , Jonathan Corbet , Alexander Shishkin , linux-arm-kernel , linux-doc@vger.kernel.org, LKML Subject: Re: [PATCH] coresight: Remove %px for printing pcsr value Message-ID: <20180502061039.GB332@leoy-ThinkPad-X240s> References: <1525237251-32496-1-git-send-email-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 01, 2018 at 10:29:46PM -0700, Kees Cook wrote: > On Tue, May 1, 2018 at 10:00 PM, Leo Yan wrote: > > The driver prints pcsr twice: the first time it uses specifier %px to > > print hexadecimal pcsr value and the second time uses specifier %pS for > > output kernel symbols. > > > > As suggested by Kees, using %pS should be sufficient and %px isn't > > necessary; the reason is if the pcsr is a kernel space address, we can > > easily get to know the code line from %pS format, on the other hand, if > > the pcsr value doesn't fall into kernel space range (e.g. if the CPU is > > stuck in firmware), %pS also gives out pcsr hexadecimal value. > > > > So this commit removes useless %px and update section "Output format" > > in the document for alignment between the code and document. > > > > Suggested-by: Kees Cook > > Cc: Mathieu Poirier > > Signed-off-by: Leo Yan > > Thanks! > > Reviewed-by: Kees Cook Thanks for reviewing, Kees. > -Kees > > > --- > > Documentation/trace/coresight-cpu-debug.txt | 4 ++-- > > drivers/hwtracing/coresight/coresight-cpu-debug.c | 2 +- > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt > > index 2b9b51c..89ab09e 100644 > > --- a/Documentation/trace/coresight-cpu-debug.txt > > +++ b/Documentation/trace/coresight-cpu-debug.txt > > @@ -177,11 +177,11 @@ Here is an example of the debugging output format: > > ARM external debug module: > > coresight-cpu-debug 850000.debug: CPU[0]: > > coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) > > -coresight-cpu-debug 850000.debug: EDPCSR: [] handle_IPI+0x174/0x1d8 > > +coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 > > coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 > > coresight-cpu-debug 850000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) > > coresight-cpu-debug 852000.debug: CPU[1]: > > coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) > > -coresight-cpu-debug 852000.debug: EDPCSR: [] debug_notifier_call+0x23c/0x358 > > +coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 > > coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 > > coresight-cpu-debug 852000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) > > diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c > > index 9cdb3fb..78a054e 100644 > > --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c > > +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c > > @@ -315,7 +315,7 @@ static void debug_dump_regs(struct debug_drvdata *drvdata) > > } > > > > pc = debug_adjust_pc(drvdata); > > - dev_emerg(dev, " EDPCSR: [<%px>] %pS\n", (void *)pc, (void *)pc); > > + dev_emerg(dev, " EDPCSR: %pS\n", (void *)pc); > > > > if (drvdata->edcidsr_present) > > dev_emerg(dev, " EDCIDSR: %08x\n", drvdata->edcidsr); > > -- > > 2.7.4 > > > > > > -- > Kees Cook > Pixel Security