1. 24 5月, 2008 7 次提交
    • P
      mmiotrace: add user documentation · c6c67c1a
      Pekka Paalanen 提交于
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      c6c67c1a
    • P
      ftrace: mmiotrace, updates · bd8ac686
      Pekka Paalanen 提交于
      here is a patch that makes mmiotrace work almost well within the tracing
      framework. The patch applies on top of my previous patch. I have my own
      output formatting in place now.
      
      Summary of changes:
      - fix the NULL dereference that was due to not calling tracing_reset()
      - add print_line() callback into struct tracer
      - implement print_line() for mmiotrace, producing up-to-spec text
      - add my output header, but that is not really called in the right place
      - rewrote the main structs in mmiotrace
      - added two new trace entry types: TRACE_MMIO_RW and TRACE_MMIO_MAP
      - made some functions in trace.c non-static
      - check current==NULL in tracing_generic_entry_update()
      - fix(?) comparison in trace_seq_printf()
      
      Things seem to work fine except a few issues. Markers (text lines injected
      into mmiotrace log) are missing, I did not feel hacking them in before we
      have variable length entries. My output header is printed only for 'trace'
      file, but not 'trace_pipe'. For some reason, despite my quick fix,
      iter->trace is NULL in print_trace_line() when called from 'trace_pipe'
      file, which means I don't get proper output formatting.
      
      I only tried by loading nouveau.ko, which just detects the card, and that
      is traced fine. I didn't try further. Map, two reads and unmap. Works
      perfectly.
      
      I am missing the information about overflows, I'd prefer to have a
      counter for lost events. I didn't try, but I guess currently there is no
      way of knowning when it overflows?
      
      So, not too far from being fully operational, it seems :-)
      And looking at the diffstat, there also is some 700-900 lines of user space
      code that just became obsolete.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      bd8ac686
    • P
      ftrace: add mmiotrace plugin · f984b51e
      Pekka Paalanen 提交于
      On Sat, 22 Mar 2008 13:07:47 +0100
      Ingo Molnar <mingo@elte.hu> wrote:
      
      > > > i'd suggest the following: pull x86.git and sched-devel.git into a
      > > > single tree [the two will combine without rejects]. Then try to add a
      > > > kernel/tracing/trace_mmiotrace.c ftrace plugin. The trace_sysprof.c
      > > > plugin might be a good example.
      > >
      > > I did this and now I have mmiotrace enabled/disabled via the tracing
      > > framework (what do we call this, since ftrace is one of the tracers?).
      >
      > cool! could you send the patches for that? (even if they are not fully
      > functional yet)
      
      Patch attached in the end. Nice to see how much code disappeared. I tried
      to mark all the features I had to break with XXX-comments.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f984b51e
    • P
      x86: mmiotrace, preview 2 · d61fc448
      Pekka Paalanen 提交于
      Kconfig.debug, Makefile and testmmiotrace.c style fixes.
      Use real mutex instead of mutex.
      Fix failure path in register probe func.
      kmmio: RCU read-locked over single stepping.
      Generate mapping id's.
      Make mmio-mod.c built-in and rewrite its locking.
      Add debugfs file to enable/disable mmiotracing.
      kmmio: use irqsave spinlocks.
      Lots of cleanups in mmio-mod.c
      Marker file moved from /proc into debugfs.
      Call mmiotrace entrypoints directly from ioremap.c.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      d61fc448
    • P
      x86: explicit call to mmiotrace in do_page_fault() · 10c43d2e
      Pekka Paalanen 提交于
      The custom page fault handler list is replaced with a single function
      pointer. All related functions and variables are renamed for
      mmiotrace.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: pq@iki.fi
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      10c43d2e
    • P
      x86: mmiotrace - trace memory mapped IO · 8b7d89d0
      Pekka Paalanen 提交于
      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: NPekka Paalanen <pq@iki.fi>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      8b7d89d0
    • P
      x86: add a list for custom page fault handlers. · 86069782
      Pekka Paalanen 提交于
      Provides kernel modules a way to register custom page fault handlers.
      On every page fault this will call a list of registered functions. The
      functions may handle the fault and force do_page_fault() to return
      immediately.
      
      This functionality is similar to the now removed page fault notifiers.
      Custom page fault handlers are used by debugging and reverse engineering
      tools. Mmiotrace is one such tool and a patch to add it into the tree
      will follow.
      
      The custom page fault handlers are called earlier in do_page_fault()
      than the page fault notifiers were.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      86069782
  2. 01 5月, 2008 4 次提交
  3. 26 4月, 2008 1 次提交
    • I
      x86: add optimized inlining · 60a3cdd0
      Ingo Molnar 提交于
      add CONFIG_OPTIMIZE_INLINING=y.
      
      allow gcc to optimize the kernel image's size by uninlining
      functions that have been marked 'inline'. Previously gcc was
      forced by Linux to always-inline these functions via a gcc
      attribute:
      
       #define inline	inline __attribute__((always_inline))
      
      Especially when the user has already selected
      CONFIG_OPTIMIZE_FOR_SIZE=y this can make a huge difference in
      kernel image size (using a standard Fedora .config):
      
         text    data     bss     dec           hex filename
         5613924  562708 3854336 10030968    990f78 vmlinux.before
         5486689  562708 3854336  9903733    971e75 vmlinux.after
      
      that's a 2.3% text size reduction (!).
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      60a3cdd0
  4. 25 4月, 2008 2 次提交
    • I
      /dev/mem: make promisc the default · 1f56cf1c
      Ingo Molnar 提交于
      default to the old semantics.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1f56cf1c
    • A
      x86: introduce /dev/mem restrictions with a config option · ae531c26
      Arjan van de Ven 提交于
      This patch introduces a restriction on /dev/mem: Only non-memory can be
      read or written unless the newly introduced config option is set.
      
      The X server needs access to /dev/mem for the PCI space, but it doesn't need
      access to memory; both the file permissions and SELinux permissions of /dev/mem
      just make X effectively super-super powerful. With the exception of the
      BIOS area, there's just no valid app that uses /dev/mem on actual memory.
      Other popular users of /dev/mem are rootkits and the like.
      (note: mmap access of memory via /dev/mem was already not allowed since
      a really long time)
      
      People who want to use /dev/mem for kernel debugging can enable the config
      option.
      
      The restrictions of this patch have been in the Fedora and RHEL kernels for
      at least 4 years without any problems.
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      ae531c26
  5. 17 4月, 2008 4 次提交
  6. 19 2月, 2008 1 次提交
  7. 10 2月, 2008 1 次提交
  8. 07 2月, 2008 1 次提交
  9. 30 1月, 2008 14 次提交
  10. 30 10月, 2007 3 次提交
  11. 26 10月, 2007 1 次提交
  12. 30 7月, 2007 1 次提交