aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/mmio-mod.c11
-rw-r--r--include/linux/mmiotrace.h14
-rw-r--r--kernel/trace/trace_mmiotrace.c20
3 files changed, 25 insertions, 20 deletions
diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c
index 278998c1998f..3b04a0126121 100644
--- a/arch/x86/mm/mmio-mod.c
+++ b/arch/x86/mm/mmio-mod.c
@@ -48,7 +48,7 @@ struct trap_reason {
48struct remap_trace { 48struct remap_trace {
49 struct list_head list; 49 struct list_head list;
50 struct kmmio_probe probe; 50 struct kmmio_probe probe;
51 unsigned long phys; 51 resource_size_t phys;
52 unsigned long id; 52 unsigned long id;
53}; 53};
54 54
@@ -275,7 +275,7 @@ static void post(struct kmmio_probe *p, unsigned long condition,
275 put_cpu_var(pf_reason); 275 put_cpu_var(pf_reason);
276} 276}
277 277
278static void ioremap_trace_core(unsigned long offset, unsigned long size, 278static void ioremap_trace_core(resource_size_t offset, unsigned long size,
279 void __iomem *addr) 279 void __iomem *addr)
280{ 280{
281 static atomic_t next_id; 281 static atomic_t next_id;
@@ -319,13 +319,14 @@ not_enabled:
319 spin_unlock_irq(&trace_lock); 319 spin_unlock_irq(&trace_lock);
320} 320}
321 321
322void 322void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
323mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr) 323 void __iomem *addr)
324{ 324{
325 if (!is_enabled()) /* recheck and proper locking in *_core() */ 325 if (!is_enabled()) /* recheck and proper locking in *_core() */
326 return; 326 return;
327 327
328 pr_debug(NAME "ioremap_*(0x%lx, 0x%lx) = %p\n", offset, size, addr); 328 pr_debug(NAME "ioremap_*(0x%llx, 0x%lx) = %p\n",
329 (unsigned long long)offset, size, addr);
329 if ((filter_offset) && (offset != filter_offset)) 330 if ((filter_offset) && (offset != filter_offset))
330 return; 331 return;
331 ioremap_trace_core(offset, size, addr); 332 ioremap_trace_core(offset, size, addr);
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h
index de8e91258da7..5cbbc374e945 100644
--- a/include/linux/mmiotrace.h
+++ b/include/linux/mmiotrace.h
@@ -2,7 +2,6 @@
2#define MMIOTRACE_H 2#define MMIOTRACE_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5
6#include <linux/list.h> 5#include <linux/list.h>
7 6
8struct kmmio_probe; 7struct kmmio_probe;
@@ -37,14 +36,15 @@ extern int kmmio_handler(struct pt_regs *regs, unsigned long addr);
37 36
38/* Called from ioremap.c */ 37/* Called from ioremap.c */
39#ifdef CONFIG_MMIOTRACE 38#ifdef CONFIG_MMIOTRACE
40extern void 39extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
41mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr); 40 void __iomem *addr);
42extern void mmiotrace_iounmap(volatile void __iomem *addr); 41extern void mmiotrace_iounmap(volatile void __iomem *addr);
43#else 42#else
44static inline void 43static inline void mmiotrace_ioremap(resource_size_t offset,
45mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr) 44 unsigned long size, void __iomem *addr)
46{ 45{
47} 46}
47
48static inline void mmiotrace_iounmap(volatile void __iomem *addr) 48static inline void mmiotrace_iounmap(volatile void __iomem *addr)
49{ 49{
50} 50}
@@ -60,7 +60,7 @@ enum mm_io_opcode {
60}; 60};
61 61
62struct mmiotrace_rw { 62struct mmiotrace_rw {
63 unsigned long phys; /* PCI address of register */ 63 resource_size_t phys; /* PCI address of register */
64 unsigned long value; 64 unsigned long value;
65 unsigned long pc; /* optional program counter */ 65 unsigned long pc; /* optional program counter */
66 int map_id; 66 int map_id;
@@ -69,7 +69,7 @@ struct mmiotrace_rw {
69}; 69};
70 70
71struct mmiotrace_map { 71struct mmiotrace_map {
72 unsigned long phys; /* base address in PCI space */ 72 resource_size_t phys; /* base address in PCI space */
73 unsigned long virt; /* base virtual address */ 73 unsigned long virt; /* base virtual address */
74 unsigned long len; /* mapping size */ 74 unsigned long len; /* mapping size */
75 int map_id; 75 int map_id;
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c
index 3c1dacdc2d85..b13dc19dcbb4 100644
--- a/kernel/trace/trace_mmiotrace.c
+++ b/kernel/trace/trace_mmiotrace.c
@@ -184,20 +184,23 @@ static int mmio_print_rw(struct trace_iterator *iter)
184 switch (entry->mmiorw.opcode) { 184 switch (entry->mmiorw.opcode) {
185 case MMIO_READ: 185 case MMIO_READ:
186 ret = trace_seq_printf(s, 186 ret = trace_seq_printf(s,
187 "R %d %lu.%06lu %d 0x%lx 0x%lx 0x%lx %d\n", 187 "R %d %lu.%06lu %d 0x%llx 0x%lx 0x%lx %d\n",
188 rw->width, secs, usec_rem, rw->map_id, rw->phys, 188 rw->width, secs, usec_rem, rw->map_id,
189 (unsigned long long)rw->phys,
189 rw->value, rw->pc, 0); 190 rw->value, rw->pc, 0);
190 break; 191 break;
191 case MMIO_WRITE: 192 case MMIO_WRITE:
192 ret = trace_seq_printf(s, 193 ret = trace_seq_printf(s,
193 "W %d %lu.%06lu %d 0x%lx 0x%lx 0x%lx %d\n", 194 "W %d %lu.%06lu %d 0x%llx 0x%lx 0x%lx %d\n",
194 rw->width, secs, usec_rem, rw->map_id, rw->phys, 195 rw->width, secs, usec_rem, rw->map_id,
196 (unsigned long long)rw->phys,
195 rw->value, rw->pc, 0); 197 rw->value, rw->pc, 0);
196 break; 198 break;
197 case MMIO_UNKNOWN_OP: 199 case MMIO_UNKNOWN_OP:
198 ret = trace_seq_printf(s, 200 ret = trace_seq_printf(s,
199 "UNKNOWN %lu.%06lu %d 0x%lx %02x,%02x,%02x 0x%lx %d\n", 201 "UNKNOWN %lu.%06lu %d 0x%llx %02x,%02x,%02x 0x%lx %d\n",
200 secs, usec_rem, rw->map_id, rw->phys, 202 secs, usec_rem, rw->map_id,
203 (unsigned long long)rw->phys,
201 (rw->value >> 16) & 0xff, (rw->value >> 8) & 0xff, 204 (rw->value >> 16) & 0xff, (rw->value >> 8) & 0xff,
202 (rw->value >> 0) & 0xff, rw->pc, 0); 205 (rw->value >> 0) & 0xff, rw->pc, 0);
203 break; 206 break;
@@ -223,8 +226,9 @@ static int mmio_print_map(struct trace_iterator *iter)
223 switch (entry->mmiorw.opcode) { 226 switch (entry->mmiorw.opcode) {
224 case MMIO_PROBE: 227 case MMIO_PROBE:
225 ret = trace_seq_printf(s, 228 ret = trace_seq_printf(s,
226 "MAP %lu.%06lu %d 0x%lx 0x%lx 0x%lx 0x%lx %d\n", 229 "MAP %lu.%06lu %d 0x%llx 0x%lx 0x%lx 0x%lx %d\n",
227 secs, usec_rem, m->map_id, m->phys, m->virt, m->len, 230 secs, usec_rem, m->map_id,
231 (unsigned long long)m->phys, m->virt, m->len,
228 0UL, 0); 232 0UL, 0);
229 break; 233 break;
230 case MMIO_UNPROBE: 234 case MMIO_UNPROBE: