提交 dee310d0 编写于 作者: P Pekka Paalanen 提交者: Thomas Gleixner

x86 mmiotrace: use resource_size_t for phys addresses

Signed-off-by: NPekka Paalanen <pq@iki.fi>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 87e547fe
...@@ -48,7 +48,7 @@ struct trap_reason { ...@@ -48,7 +48,7 @@ struct trap_reason {
struct remap_trace { struct remap_trace {
struct list_head list; struct list_head list;
struct kmmio_probe probe; struct kmmio_probe probe;
unsigned long phys; resource_size_t phys;
unsigned long id; unsigned long id;
}; };
...@@ -275,7 +275,7 @@ static void post(struct kmmio_probe *p, unsigned long condition, ...@@ -275,7 +275,7 @@ static void post(struct kmmio_probe *p, unsigned long condition,
put_cpu_var(pf_reason); put_cpu_var(pf_reason);
} }
static void ioremap_trace_core(unsigned long offset, unsigned long size, static void ioremap_trace_core(resource_size_t offset, unsigned long size,
void __iomem *addr) void __iomem *addr)
{ {
static atomic_t next_id; static atomic_t next_id;
...@@ -319,13 +319,14 @@ static void ioremap_trace_core(unsigned long offset, unsigned long size, ...@@ -319,13 +319,14 @@ static void ioremap_trace_core(unsigned long offset, unsigned long size,
spin_unlock_irq(&trace_lock); spin_unlock_irq(&trace_lock);
} }
void void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr) void __iomem *addr)
{ {
if (!is_enabled()) /* recheck and proper locking in *_core() */ if (!is_enabled()) /* recheck and proper locking in *_core() */
return; return;
pr_debug(NAME "ioremap_*(0x%lx, 0x%lx) = %p\n", offset, size, addr); pr_debug(NAME "ioremap_*(0x%llx, 0x%lx) = %p\n",
(unsigned long long)offset, size, addr);
if ((filter_offset) && (offset != filter_offset)) if ((filter_offset) && (offset != filter_offset))
return; return;
ioremap_trace_core(offset, size, addr); ioremap_trace_core(offset, size, addr);
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define MMIOTRACE_H #define MMIOTRACE_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/list.h> #include <linux/list.h>
struct kmmio_probe; struct kmmio_probe;
...@@ -37,14 +36,15 @@ extern int kmmio_handler(struct pt_regs *regs, unsigned long addr); ...@@ -37,14 +36,15 @@ extern int kmmio_handler(struct pt_regs *regs, unsigned long addr);
/* Called from ioremap.c */ /* Called from ioremap.c */
#ifdef CONFIG_MMIOTRACE #ifdef CONFIG_MMIOTRACE
extern void extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr); void __iomem *addr);
extern void mmiotrace_iounmap(volatile void __iomem *addr); extern void mmiotrace_iounmap(volatile void __iomem *addr);
#else #else
static inline void static inline void mmiotrace_ioremap(resource_size_t offset,
mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr) unsigned long size, void __iomem *addr)
{ {
} }
static inline void mmiotrace_iounmap(volatile void __iomem *addr) static inline void mmiotrace_iounmap(volatile void __iomem *addr)
{ {
} }
...@@ -60,7 +60,7 @@ enum mm_io_opcode { ...@@ -60,7 +60,7 @@ enum mm_io_opcode {
}; };
struct mmiotrace_rw { struct mmiotrace_rw {
unsigned long phys; /* PCI address of register */ resource_size_t phys; /* PCI address of register */
unsigned long value; unsigned long value;
unsigned long pc; /* optional program counter */ unsigned long pc; /* optional program counter */
int map_id; int map_id;
...@@ -69,7 +69,7 @@ struct mmiotrace_rw { ...@@ -69,7 +69,7 @@ struct mmiotrace_rw {
}; };
struct mmiotrace_map { struct mmiotrace_map {
unsigned long phys; /* base address in PCI space */ resource_size_t phys; /* base address in PCI space */
unsigned long virt; /* base virtual address */ unsigned long virt; /* base virtual address */
unsigned long len; /* mapping size */ unsigned long len; /* mapping size */
int map_id; int map_id;
......
...@@ -184,20 +184,23 @@ static int mmio_print_rw(struct trace_iterator *iter) ...@@ -184,20 +184,23 @@ static int mmio_print_rw(struct trace_iterator *iter)
switch (entry->mmiorw.opcode) { switch (entry->mmiorw.opcode) {
case MMIO_READ: case MMIO_READ:
ret = trace_seq_printf(s, ret = trace_seq_printf(s,
"R %d %lu.%06lu %d 0x%lx 0x%lx 0x%lx %d\n", "R %d %lu.%06lu %d 0x%llx 0x%lx 0x%lx %d\n",
rw->width, secs, usec_rem, rw->map_id, rw->phys, rw->width, secs, usec_rem, rw->map_id,
(unsigned long long)rw->phys,
rw->value, rw->pc, 0); rw->value, rw->pc, 0);
break; break;
case MMIO_WRITE: case MMIO_WRITE:
ret = trace_seq_printf(s, ret = trace_seq_printf(s,
"W %d %lu.%06lu %d 0x%lx 0x%lx 0x%lx %d\n", "W %d %lu.%06lu %d 0x%llx 0x%lx 0x%lx %d\n",
rw->width, secs, usec_rem, rw->map_id, rw->phys, rw->width, secs, usec_rem, rw->map_id,
(unsigned long long)rw->phys,
rw->value, rw->pc, 0); rw->value, rw->pc, 0);
break; break;
case MMIO_UNKNOWN_OP: case MMIO_UNKNOWN_OP:
ret = trace_seq_printf(s, ret = trace_seq_printf(s,
"UNKNOWN %lu.%06lu %d 0x%lx %02x,%02x,%02x 0x%lx %d\n", "UNKNOWN %lu.%06lu %d 0x%llx %02x,%02x,%02x 0x%lx %d\n",
secs, usec_rem, rw->map_id, rw->phys, secs, usec_rem, rw->map_id,
(unsigned long long)rw->phys,
(rw->value >> 16) & 0xff, (rw->value >> 8) & 0xff, (rw->value >> 16) & 0xff, (rw->value >> 8) & 0xff,
(rw->value >> 0) & 0xff, rw->pc, 0); (rw->value >> 0) & 0xff, rw->pc, 0);
break; break;
...@@ -223,8 +226,9 @@ static int mmio_print_map(struct trace_iterator *iter) ...@@ -223,8 +226,9 @@ static int mmio_print_map(struct trace_iterator *iter)
switch (entry->mmiorw.opcode) { switch (entry->mmiorw.opcode) {
case MMIO_PROBE: case MMIO_PROBE:
ret = trace_seq_printf(s, ret = trace_seq_printf(s,
"MAP %lu.%06lu %d 0x%lx 0x%lx 0x%lx 0x%lx %d\n", "MAP %lu.%06lu %d 0x%llx 0x%lx 0x%lx 0x%lx %d\n",
secs, usec_rem, m->map_id, m->phys, m->virt, m->len, secs, usec_rem, m->map_id,
(unsigned long long)m->phys, m->virt, m->len,
0UL, 0); 0UL, 0);
break; break;
case MMIO_UNPROBE: case MMIO_UNPROBE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册