From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753995AbcFQWXs (ORCPT ); Fri, 17 Jun 2016 18:23:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:2455 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750840AbcFQWXq (ORCPT ); Fri, 17 Jun 2016 18:23:46 -0400 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: benh@au1.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-pci@vger.kernel.org Subject: Re: [PATCH] tracing: Expose CPU physical addresses (resource values) for PCI devices From: Benjamin Herrenschmidt Reply-To: benh@au1.ibm.com To: Steven Rostedt , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, karol herbst , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Pekka Paalanen , Ingo Molnar , Ben Skeggs , Yinghai Lu , koriakin@0x04.net Date: Sat, 18 Jun 2016 08:23:23 +1000 In-Reply-To: <20160617175901.7bd90d14@gandalf.local.home> References: <20160511190657.5898.4248.stgit@bhelgaas-glaptop2.roam.corp.google.com> <20160617175901.7bd90d14@gandalf.local.home> Organization: IBM Australia Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.3 (3.20.3-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061722-0048-0000-0000-000001950D03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061722-0049-0000-0000-000045F91B78 Message-Id: <1466202203.24271.76.camel@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-17_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606170257 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-06-17 at 17:59 -0400, Steven Rostedt wrote: > Sorry for the late reply, this patch got pushed down in my INBOX. > > Could I get someone from PPC to review this patch, just to be safe? The patch makes sense, I can try getting somebody onto porting mmiotrace one of these days. Cheers, Ben. > Thanks! > > -- Steve > > > > On Wed, 11 May 2016 14:06:57 -0500 > Bjorn Helgaas wrote: > > > Previously, mmio_print_pcidev() put "user" addresses in the trace > > buffer. > > On most architectures, these are the same as CPU physical > > addresses, but on > > microblaze, mips, powerpc, and sparc, they may be something else, > > typically > > a raw BAR value (a bus address as opposed to a CPU address). > > > > Always expose the CPU physical address to avoid this arch-dependent > > behavior. > > > > This change should have no user-visible effect because this file > > currently > > depends on CONFIG_HAVE_MMIOTRACE_SUPPORT, which is only defined for > > x86, > > and pci_resource_to_user() is a no-op on x86. > > > > Signed-off-by: Bjorn Helgaas > > --- > >  kernel/trace/trace_mmiotrace.c |   10 +++------- > >  1 file changed, 3 insertions(+), 7 deletions(-) > > > > diff --git a/kernel/trace/trace_mmiotrace.c > > b/kernel/trace/trace_mmiotrace.c > > index 68f376c..cd7480d 100644 > > --- a/kernel/trace/trace_mmiotrace.c > > +++ b/kernel/trace/trace_mmiotrace.c > > @@ -68,19 +68,15 @@ static void mmio_print_pcidev(struct trace_seq > > *s, const struct pci_dev *dev) > >   trace_seq_printf(s, "PCIDEV %02x%02x %04x%04x %x", > >    dev->bus->number, dev->devfn, > >    dev->vendor, dev->device, dev->irq); > > - /* > > -  * XXX: is pci_resource_to_user() appropriate, since we > > are > > -  * supposed to interpret the __ioremap() phys_addr > > argument based on > > -  * these printed values? > > -  */ > >   for (i = 0; i < 7; i++) { > > - pci_resource_to_user(dev, i, &dev->resource[i], > > &start, &end); > > + start = dev->resource[i].start; > >   trace_seq_printf(s, " %llx", > >   (unsigned long long)(start | > >   (dev->resource[i].flags & > > PCI_REGION_FLAG_MASK))); > >   } > >   for (i = 0; i < 7; i++) { > > - pci_resource_to_user(dev, i, &dev->resource[i], > > &start, &end); > > + start = dev->resource[i].start; > > + end = dev->resource[i].end; > >   trace_seq_printf(s, " %llx", > >   dev->resource[i].start < dev- > > >resource[i].end ? > >   (unsigned long long)(end - start) + 1 : > > 0); > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev