From: Bjorn Helgaas <bhelgaas@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-pci@vger.kernel.org, karol herbst <karolherbst@gmail.com>,
linux-kernel@vger.kernel.org,
Pekka Paalanen <ppaalanen@gmail.com>,
Ingo Molnar <mingo@redhat.com>, Ben Skeggs <bskeggs@redhat.com>,
Yinghai Lu <yinghai@kernel.org>,
koriakin@0x04.net
Subject: [PATCH] tracing: Expose CPU physical addresses (resource values) for PCI devices
Date: Wed, 11 May 2016 14:06:57 -0500 [thread overview]
Message-ID: <20160511190657.5898.4248.stgit@bhelgaas-glaptop2.roam.corp.google.com> (raw)
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 <bhelgaas@google.com>
---
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);
next reply other threads:[~2016-05-11 19:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 19:06 Bjorn Helgaas [this message]
2016-06-17 21:59 ` Steven Rostedt
2016-06-17 22:23 ` Benjamin Herrenschmidt
2016-06-20 13:56 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160511190657.5898.4248.stgit@bhelgaas-glaptop2.roam.corp.google.com \
--to=bhelgaas@google.com \
--cc=bskeggs@redhat.com \
--cc=karolherbst@gmail.com \
--cc=koriakin@0x04.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ppaalanen@gmail.com \
--cc=rostedt@goodmis.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®