Received: by 10.192.165.148 with SMTP id m20csp242437imm; Tue, 1 May 2018 22:30:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpOz9AbqNJvVK3kTkefe9pSrSbRIkY3p4jZGqDIjvtFmpB8rnSJjw+I1u+ZoiapBP+zBJLu X-Received: by 2002:a17:902:bf4b:: with SMTP id u11-v6mr18102708pls.30.1525239020548; Tue, 01 May 2018 22:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525239020; cv=none; d=google.com; s=arc-20160816; b=k8TkNEF8DN6lCjUm1f5UsBrVJPhq06VN+y/cnhtn4xW1KsTGWwOASVmsghPh02XxZn UPwVk9553RyPtUGPp+c4OWrd9Vsf/JQC382+zYsLBlMz2IrENaI4N4YMfhqWuOOIuh1A 86wfCSjUVIhMz/I62Cno9voGInni3eahlrm7Ot6/6JWdVFiil5ywpE+9tAh9BV0ARY2d vCcMrkLLRWyOG8tGzB1ubMq7qtpxcUY4L2b8n1lx3idZlsdqiCbhir87CCeVd0S4VPAF UV6xySzrgQuxxlJYZdhQY9FoQAe2/SM8hOmS42yBuvNFgro3qRiP6++rrSYMXauTVWMC dvpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=3NDMdaLyV5MDrb8V8c+f4Zq3IUSxI38rpoFYSdrZ0eE=; b=dzpxO4xiliD5wzG05y7mAJUZBKatooIIPSvIhs3H3VLl0m/FL1eaiJeWulnxbZbYhl YUdm3YoGnePE8FklU8UB1i0sElJB6zXOwtRrCLOomBLxLCx1JQoNIK1/pW3mb5ztQknD naBpxaRfEQqwfrKA/tWv9ttFmUhM6q+faY63GFuO1TQlL2MKfdrFqryZ0OHyTy0tPDHO SH96mDSpp+Gq2FIzaOh7PuXLMJ+X4ttNQipKt28/mXZ617bDHt2ayB2zEBAIuGxS4W0O OM6Az1GlP6pKqKMNrZUZrCmcBOzH2nQ4Xpo5cN7m7329APjKzDL5Cim6KPreEifCzlJM K1Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=mZ3jO4Qm; dkim=fail header.i=@chromium.org header.s=google header.b=dFbPqcIn; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si9021265pgf.13.2018.05.01.22.30.05; Tue, 01 May 2018 22:30:20 -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=fail header.i=@google.com header.s=20161025 header.b=mZ3jO4Qm; dkim=fail header.i=@chromium.org header.s=google header.b=dFbPqcIn; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751026AbeEBF3w (ORCPT + 99 others); Wed, 2 May 2018 01:29:52 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:32972 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbeEBF3t (ORCPT ); Wed, 2 May 2018 01:29:49 -0400 Received: by mail-vk0-f66.google.com with SMTP id q189-v6so8252279vkb.0 for ; Tue, 01 May 2018 22:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3NDMdaLyV5MDrb8V8c+f4Zq3IUSxI38rpoFYSdrZ0eE=; b=mZ3jO4QmpPIrxsj1qvbkm2Tvgcg/hY0xtAC7LtJ78ieYxn3g7lxoe3oA0A5H8N1dxt WV3jjtmOZ0NWSRqDis6rHhSnKQavfJ+CCaTmbcKj909wGJumpzfTm7AxDJl61438Bdk1 qqqFIx+LBlzn0mPU48tftaVFLJrN96++OC63hk2zoDAc60vvoQS/NmoHcf1+jMpwCbIq P53KkSXGQ0xd9rry6Dp7myjatFrigCFJPUvO/0XcJnAXBAzvU8+gcqZJ5jgjQODdqGjY WUUQFekdiIaNtpArZ53rwD4EJ5/338QuFzI7pMseJJP8pqGHOO3wTtROlqJP2xn6iTEx mqQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3NDMdaLyV5MDrb8V8c+f4Zq3IUSxI38rpoFYSdrZ0eE=; b=dFbPqcInI0TFfhvnKrW6RE9i0E/IY1sNPQW8T1bUhAaUkZ4q1BsKWAI0uqW2QeCtEx 4dkl9hNtcvwAnZqOJ4sYrQZHm1lGXWpAy6iWB2eVPVJ6lDVrgJdhXAsXeI0yX/rPD3wx H66PdIE1AYk9kOx4MvQPKKfgfcBZawNrRCIzQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3NDMdaLyV5MDrb8V8c+f4Zq3IUSxI38rpoFYSdrZ0eE=; b=Q65zC6EoCuB+E5Jgi81Uhbt1kZ8UQCDC6DgVj7jPLKND8Aocik6HKeUmRtsjvN7h30 TkkpsvA8D6KUqD/GwczvFz09BCESbhicV6M4rAuxQdkfGtcqRTaMZBjdJPpVdg8gjDCW OsaMTgNXEzM7Y5WtNbjEP9PB8jVLXFaSEXdrxxPrHXtm77pau7ABfESC5LAfjiZhz/bZ 0Yxbvd/TcqLokQjHO0q23qbI/h3hpU6D76MmxSYTZBUFCIWLJNEUky4Ley/F/DXGHi47 KGRNlEZZJ1Fz3qCTtAHqlyXWXtWBCvmZAOHac+Eg3B/kljHdxf8Awd2aaNhFlUmVYDXy sNLw== X-Gm-Message-State: ALQs6tCM6YdjYxx8l/kmK5OCMDCibRMotWcNoCHxNUq3lEfSi/izsPZE sPLxw64sw3NhBAVoN6MkHzcqAdcsjIWQHnj4jbtXsg== X-Received: by 2002:a1f:b9d2:: with SMTP id j201-v6mr16663422vkf.123.1525238988000; Tue, 01 May 2018 22:29:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.11.209 with HTTP; Tue, 1 May 2018 22:29:46 -0700 (PDT) In-Reply-To: <1525237251-32496-1-git-send-email-leo.yan@linaro.org> References: <1525237251-32496-1-git-send-email-leo.yan@linaro.org> From: Kees Cook Date: Tue, 1 May 2018 22:29:46 -0700 X-Google-Sender-Auth: b6u9d_CVY9wa2wowmJyj4vDDg6Y Message-ID: Subject: Re: [PATCH] coresight: Remove %px for printing pcsr value To: Leo Yan Cc: Mathieu Poirier , Jonathan Corbet , Alexander Shishkin , linux-arm-kernel , linux-doc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -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