]> err.no Git - linux-2.6/commit
x86: mmiotrace - trace memory mapped IO
authorPekka Paalanen <pq@iki.fi>
Mon, 12 May 2008 19:20:56 +0000 (21:20 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 24 May 2008 09:21:14 +0000 (11:21 +0200)
commit8b7d89d02ef3c6a7c73d6596f28cea7632850af4
tree32601bf4f34dd9e3ec1e9610c555e10dc448006c
parent677aa9f77e8de3791b481a0cec6c8b84d1eec626
x86: mmiotrace - trace memory mapped IO

Mmiotrace is a tool for trapping memory mapped IO (MMIO) accesses within
the kernel. It is used for debugging and especially for reverse
engineering evil binary drivers.

Mmiotrace works by wrapping the ioremap family of kernel functions and
marking the returned pages as not present. Access to the IO memory
triggers a page fault, which will be handled by mmiotrace's custom page
fault handler. This will single-step the faulted instruction with the
MMIO page marked as present. Access logs are directed to user space via
relay and debug_fs.

This page fault approach is necessary, because binary drivers have
readl/writel etc. calls inlined and therefore extremely difficult to
trap with with e.g. kprobes.

This patch depends on the custom page fault handlers patch.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/Kconfig.debug
arch/x86/kernel/Makefile
arch/x86/kernel/init_task.c
arch/x86/kernel/mmiotrace/Makefile [new file with mode: 0644]
arch/x86/kernel/mmiotrace/kmmio.c [new file with mode: 0644]
arch/x86/kernel/mmiotrace/kmmio.h [new file with mode: 0644]
arch/x86/kernel/mmiotrace/mmio-mod.c [new file with mode: 0644]
arch/x86/kernel/mmiotrace/pf_in.c [new file with mode: 0644]
arch/x86/kernel/mmiotrace/pf_in.h [new file with mode: 0644]
arch/x86/kernel/mmiotrace/testmmiotrace.c [new file with mode: 0644]
include/linux/mmiotrace.h [new file with mode: 0644]