1. 26 Mar, 2006 40 commits
    • Dave Peterson's avatar
      [PATCH] EDAC: documentation spelling fixes · f3479816
      Dave Peterson authored
      Fix spelling errors in EDAC documentation.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f3479816
    • Dave Peterson's avatar
      [PATCH] EDAC: formatting cleanup · e7ecd891
      Dave Peterson authored
      Cosmetic indentation/formatting cleanup for EDAC code.  Make sure we
      are using tabs rather than spaces to indent, etc.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e7ecd891
    • Dave Peterson's avatar
      [PATCH] EDAC: reorder EXPORT_SYMBOL macros · 54933ddd
      Dave Peterson authored
      Fix EDAC code so EXPORT_SYMBOL comes after the function that is being
      exported.  This is to maintain consistency with the rest of the kernel.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      54933ddd
    • Dave Peterson's avatar
      [PATCH] EDAC: Kconfig dependency changes · 39f1d8d3
      Dave Peterson authored
      - Add x86 dependency in drivers/edac/Kconfig for all current
        platform-specific modules.
      
      - Add PCI dependency to Radisys 82600 driver
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      39f1d8d3
    • Dave Peterson's avatar
      [PATCH] EDAC: protect memory controller list · 18dbc337
      Dave Peterson authored
      - Fix code so we always hold mem_ctls_mutex while we are stepping
        through the list of mem_ctl_info structures.  Otherwise bad things
        may happen if one task is stepping through the list while another
        task is modifying it.  We may eventually want to use reference
        counting to manage the mem_ctl_info structures.  In the meantime we
        may as well fix this bug.
      
      - Don't disable interrupts while we are walking the list of
        mem_ctl_info structures in check_mc_devices().  This is unnecessary.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      18dbc337
    • Dave Peterson's avatar
      [PATCH] EDAC: kobject/sysfs fixes · 472678eb
      Dave Peterson authored
      - After we unregister a kobject, wait for our kobject release method
        to call complete().  This causes us to wait until the kobject
        reference count reaches 0.  Otherwise, a task accessing the EDAC
        sysfs interface can hold the reference count above 0 until after the
        EDAC module has been unloaded.  When the reference count finally
        drops to 0, this will result in an attempt to call our release
        method inside the EDAC module after the module has already been
        unloaded.
      
        This isn't the best fix, since a process can get stuck sleeping forever
        uninterruptibly if the user does the following:
      
            rmmod my_module < /sys/my_sysfs/file
      
        I'll go back and implement a better fix later.  However this should
        be ok for now.
      
      - Call edac_remove_sysfs_mci_device() from edac_mc_del_mc() rather
        than from edac_mc_free().  Since edac_mc_add_mc() calls
        edac_create_sysfs_mci_device(), edac_mc_del_mc() should call
        edac_remove_sysfs_mci_device().
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      472678eb
    • Dave Peterson's avatar
      [PATCH] EDAC: kobject_init/kobject_put fixes · 6e5a8748
      Dave Peterson authored
      - Remove calls to kobject_init().  These are unnecessary because
        kobject_register() calls kobject_init().
      
      - Remove extra calls to kobject_put().  When we call
        kobject_unregister(), this releases our reference to the kobject.
        The extra calls to kobject_put() may cause the reference count to
        drop to 0 while a kobject is still in use.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6e5a8748
    • Dave Peterson's avatar
      [PATCH] EDAC: edac_mc_add_mc fix [2/2] · 028a7b6d
      Dave Peterson authored
      This is part 2 of a 2-part patch set.
      
      Fix edac_mc_add_mc() so it cleans up properly if call to
      edac_create_sysfs_mci_device() fails.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      028a7b6d
    • Dave Peterson's avatar
      [PATCH] EDAC: edac_mc_add_mc fix [1/2] · a1d03fcc
      Dave Peterson authored
      This is part 1 of a 2-part patch set.  The code changes are split into
      two parts to make the patches more readable.
      
      Move complete_mc_list_del() and del_mc_from_global_list() so we can
      call del_mc_from_global_list() from edac_mc_add_mc() without forward
      declarations.  Perhaps using forward declarations would be better?
      I'm doing things this way because the rest of the code is missing
      them.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a1d03fcc
    • Dave Peterson's avatar
      [PATCH] EDAC: cleanup code for clearing initial errors · 749ede57
      Dave Peterson authored
      Fix xxx_probe1() functions so they call xxx_get_error_info() functions
      to clear initial errors.  This is simpler and cleaner than duplicating
      the low-level code for accessing PCI config space.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      749ede57
    • Dave Peterson's avatar
      [PATCH] EDAC: e7xxx fix minor logic bug · d38fde84
      Dave Peterson authored
      Fix minor logic bug in e7xxx_remove_one().
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d38fde84
    • Dave Peterson's avatar
      [PATCH] EDAC: i82875p cleanup · 637beb69
      Dave Peterson authored
      - Fix i82875p_probe1() so it calls pci_get_device() instead of
        pci_find_device().
      - Fix i82875p_probe1() so it cleans up properly on failure.
      - Fix i82875p_init() so it cleans up properly on failure.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      637beb69
    • Dave Peterson's avatar
      [PATCH] EDAC: i82860 cleanup · e8a491b4
      Dave Peterson authored
      - Fix i82860_init() so it cleans up properly on failure.
      - Fix i82860_exit() so it cleans up properly.
      - Fix typo in comment (i.e. www.redhat.com.com).
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e8a491b4
    • Dave Peterson's avatar
      [PATCH] EDAC: e752x cleanup · 3847bccc
      Dave Peterson authored
      - Add ctl_dev field to "struct e752x_dev_info".  Then we can eliminate
        ugly switch statement from e752x_probe1().
      
      - Remove code from e752x_probe1() that clears initial PCI bus parity
        errors.  The core EDAC module already does this.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3847bccc
    • Dave Peterson's avatar
      [PATCH] EDAC: amd76x pci_dev_get/pci_dev_put fixes · 225159bd
      Dave Peterson authored
      Eliminate unnecessary calls to pci_dev_get() and pci_dev_put() from
      amd76x driver.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      225159bd
    • Dave Peterson's avatar
      [PATCH] EDAC: name cleanup · 680cbbbb
      Dave Peterson authored
      Perform the following name substitutions on all source files:
      
          sed 's/BS_MOD_STR/EDAC_MOD_STR/g'
          sed 's/bs_thread_info/edac_thread_info/g'
          sed 's/bs_thread/edac_thread/g'
          sed 's/bs_xstr/edac_xstr/g'
          sed 's/bs_str/edac_str/g'
      
      The names that start with BS_ or bs_ are artifacts of when the code
      was called "bluesmoke".
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      680cbbbb
    • Dave Peterson's avatar
      [PATCH] EDAC: printk cleanup · 537fba28
      Dave Peterson authored
      This implements the following idea:
      
      On Monday 30 January 2006 19:22, Eric W. Biederman wrote:
      > One piece missing from this conversation is the issue that we need errors
      > in a uniform format.  That is why edac_mc has helper functions.
      >
      > However there will always be errors that don't fit any particular model.
      > Could we add a edac_printk(dev, );  That is similar to dev_printk but
      > prints out an EDAC header and the device on which the error was found?
      > Letting the rest of the string be user specified.
      >
      > For actual control that interface may be to blunt, but at least for people
      > looking in the logs it allows all of the errors to be detected and
      > harvested.
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      537fba28
    • Dave Peterson's avatar
      [PATCH] EDAC: switch to kthread_ API · f2fe42ab
      Dave Peterson authored
      This patch was originally posted by Christoph Hellwig (see
      http://lkml.org/lkml/2006/2/14/331):
      
      "Christoph Hellwig" <hch@lst.de> wrote:
      > Use the kthread_ API instead of opencoding lots of hairy code for kernel
      > thread creation and teardown, including tasklist_lock abuse.
      >
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
      Cc: <dave_peterson@pobox.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f2fe42ab
    • Eric Sesterhenn's avatar
      [PATCH] Dead code in drivers/isdn/avm/avmcard.h · dac5bafa
      Eric Sesterhenn authored
      This fixes coverity id #2.  the if (i==0) is pretty useless, since we
      assing i=0, just the line before.
      Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
      Cc: Karsten Keil <kkeil@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      dac5bafa
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - M105 USB DECT adapter · 07dc1f9f
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the connection-specific module "usb_gigaset", the hardware
      driver for Gigaset base stations connected via the M105 USB DECT adapter.  It
      contains the code for handling probe/disconnect, AT command/response
      transmission, and call setup and termination, as well as handling asynchronous
      data transfers, PPP framing, byte stuffing, and flow control.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      07dc1f9f
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - isochronous data handler · 76bb4685
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the payload data handler for the connection-specific module
      "bas_gigaset".  It contains the code for handling isochronous data transfers,
      HDLC framing and flow control.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      76bb4685
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - direct USB connection · cf7776dc
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the main source file of the connection-specific module
      "bas_gigaset", the hardware driver for Gigaset base stations connected
      directly to the computer via USB.  It contains the code for handling
      probe/disconnect, AT command/response transmission, and call setup and
      termination.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      cf7776dc
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - procfs interface · 982da5a1
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the procfs interface to the gigaset module.  The procfs
      interface provides access to status information and statistics about the
      Gigaset devices.  If the drivers are built with the debugging option it also
      allows to change the amount of debugging output on the fly.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      982da5a1
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - tty interface · ee8a4b7f
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the tty interface to the gigaset module.  The tty interface
      provides direct access to the AT command set of the Gigaset devices.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ee8a4b7f
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - isdn4linux interface · 3c66a225
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the isdn4linux subsystem interface to the gigaset module.  The
      isdn4linux subsystem interface handles requests from and notifications to the
      isdn4linux subsystem.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3c66a225
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - event layer · 14fa73a7
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the event layer to the gigaset module.  The event layer
      serializes events from hardware, userspace, and other kernel subsystems.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      14fa73a7
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - common module · 6fd5ea63
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      This patch adds the common include file for the Siemens Gigaset drivers,
      providing definitions used by all of the Gigaset ISDN driver source files.  It
      also adds the main source file of the gigaset module which manages common
      functions not specific to the type of connection to the device.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6fd5ea63
    • Hansjoerg Lipp's avatar
      [PATCH] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles · 0a34eb8f
      Hansjoerg Lipp authored
      And: Tilman Schmidt <tilman@imap.cc>
      
      The following patches add drivers for the Siemens Gigaset 3070 family of ISDN
      DECT PABXes connected via USB, either directly or over a DECT link using a
      Gigaset M105 or compatible DECT data adapter.  The devices are integrated as
      ISDN adapters within the isdn4linux framework, supporting incoming and
      outgoing voice and data connections, and also as tty devices providing access
      to device specific AT commands.
      
      Supported devices include models 3070, 3075, 4170, 4175, SX205, SX255, and
      SX353 from the Siemens Gigaset product family, as well as the technically
      identical models 45isdn and 721X from the Deutsche Telekom Sinus series.
      Supported DECT adapters are the Gigaset M105 data and the technically
      identical Gigaset USB Adapter DECT, Sinus 45 data 2, and Sinus 721 data (but
      not the Gigaset M34 and Sinus 702 data which advertise themselves as CDC-ACM
      devices).
      
      These drivers have been developed over the last four years within the
      SourceForge project http://sourceforge.net/projects/gigaset307x/.  They are
      being used successfully in several installations for dial-in Internet access
      and for voice call switching with Asterisk.
      
      This is our second attempt at submitting these drivers, taking into account
      the comments we received to our first submission on 2005-12-11.
      
      The patch set adds three kernel modules:
      
      - a common module "gigaset" encapsulating the common logic for
        controlling the PABX and the interfaces to userspace and the
        isdn4linux subsystem.
      
      - a connection-specific module "bas_gigaset" which handles
        communication with the PABX over a direct USB connection.
      
      - a connection-specific module "usb_gigaset" which does the same
        for a DECT connection using the Gigaset M105 USB DECT adapter.
      
      We also have a module "ser_gigaset" which supports the Gigaset M101 RS232 DECT
      adapter, but we didn't judge it fit for inclusion in the kernel, as it does
      direct programming of a i8250 serial port.  It should probably be rewritten as
      a serial line discipline but so far we lack the neccessary knowledge about
      writing a line discipline for that.
      
      The drivers have been working with kernel releases 2.2 and 2.4 as well as 2.6,
      and although we took efforts to remove the compatibility code for this
      submission, it probably still shows in places.  Please make allowances.
      
      This patch:
      
      Prepare the kernel build infrastructure for addition of the Gigaset ISDN
      drivers.  It creates a Makefile and Kconfig file for the Gigaset driver and
      hooks them into those of the isdn4linux subsystem.  It also adds a MAINTAINERS
      entry for the driver.
      
      This patch depends on patches 2 to 9 of the present set, as without the actual
      source files, activating the options added here will cause the kernel build to
      fail.
      Signed-off-by: default avatarHansjoerg Lipp <hjlipp@web.de>
      Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0a34eb8f
    • Prasanna S Panchamukhi's avatar
      [PATCH] kprobes: fix broken fault handling for sparc64 · b6700096
      Prasanna S Panchamukhi authored
      Provide proper kprobes fault handling, if a user-specified pre/post handlers
      tries to access user address space, through copy_from_user(), get_user() etc.
      
      The user-specified fault handler gets called only if the fault occurs while
      executing user-specified handlers.  In such a case user-specified handler is
      allowed to fix it first, later if the user-specifed fault handler does not fix
      it, we try to fix it by calling fix_exception().
      
      The user-specified handler will not be called if the fault happens when single
      stepping the original instruction, instead we reset the current probe and
      allow the system page fault handler to fix it up.
      
      I could not test this patch for sparc64.
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b6700096
    • Prasanna S Panchamukhi's avatar
      [PATCH] kprobes: fix broken fault handling for ia64 · c04c1c81
      Prasanna S Panchamukhi authored
      Provide proper kprobes fault handling, if a user-specified pre/post handlers
      tries to access user address space, through copy_from_user(), get_user() etc.
      
      The user-specified fault handler gets called only if the fault occurs while
      executing user-specified handlers.  In such a case user-specified handler is
      allowed to fix it first, later if the user-specifed fault handler does not fix
      it, we try to fix it by calling fix_exception().
      
      The user-specified handler will not be called if the fault happens when single
      stepping the original instruction, instead we reset the current probe and
      allow the system page fault handler to fix it up.
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Acked-by: Anil S Keshavamurthy<anil.s.keshavamurthy@intel.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c04c1c81
    • Prasanna S Panchamukhi's avatar
      [PATCH] kprobes: fix broken fault handling for powerpc64 · 50e21f2b
      Prasanna S Panchamukhi authored
      Provide proper kprobes fault handling, if a user-specified pre/post handlers
      tries to access user address space, through copy_from_user(), get_user() etc.
      
      The user-specified fault handler gets called only if the fault occurs while
      executing user-specified handlers.  In such a case user-specified handler is
      allowed to fix it first, later if the user-specifed fault handler does not fix
      it, we try to fix it by calling fix_exception().
      
      The user-specified handler will not be called if the fault happens when single
      stepping the original instruction, instead we reset the current probe and
      allow the system page fault handler to fix it up.
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      50e21f2b
    • Prasanna S Panchamukhi's avatar
      [PATCH] kprobes: fix broken fault handling for x86_64 · c28f8966
      Prasanna S Panchamukhi authored
      Provide proper kprobes fault handling, if a user-specified pre/post handlers
      tries to access user address space, through copy_from_user(), get_user() etc.
      
      The user-specified fault handler gets called only if the fault occurs while
      executing user-specified handlers.  In such a case user-specified handler is
      allowed to fix it first, later if the user-specifed fault handler does not fix
      it, we try to fix it by calling fix_exception().
      
      The user-specified handler will not be called if the fault happens when single
      stepping the original instruction, instead we reset the current probe and
      allow the system page fault handler to fix it up.
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Andi Kleen <ak@muc.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c28f8966
    • Prasanna S Panchamukhi's avatar
      [PATCH] kprobes: fix broken fault handling for i386 · b4026513
      Prasanna S Panchamukhi authored
      Provide proper kprobes fault handling, if a user-specified pre/post handlers
      tries to access user address space, through copy_from_user(), get_user() etc.
      
      The user-specified fault handler gets called only if the fault occurs while
      executing user-specified handlers.  In such a case user-specified handler is
      allowed to fix it first, later if the user-specifed fault handler does not fix
      it, we try to fix it by calling fix_exception().
      
      The user-specified handler will not be called if the fault happens when single
      stepping the original instruction, instead we reset the current probe and
      allow the system page fault handler to fix it up.
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b4026513
    • bibo,mao's avatar
      [PATCH] kprobe handler: discard user space trap · 2326c770
      bibo,mao authored
      Currently kprobe handler traps only happen in kernel space, so function
      kprobe_exceptions_notify should skip traps which happen in user space.
      This patch modifies this, and it is based on 2.6.16-rc4.
      Signed-off-by: default avatarbibo mao <bibo.mao@intel.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>
      Cc: <hiramatu@sdl.hitachi.co.jp>
      Signed-off-by: default avatarPrasanna S Panchamukhi <prasanna@in.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      2326c770
    • bibo mao's avatar
      [PATCH] kretprobe instance recycled by parent process · c6fd91f0
      bibo mao authored
      When kretprobe probes the schedule() function, if the probed process exits
      then schedule() will never return, so some kretprobe instances will never
      be recycled.
      
      In this patch the parent process will recycle retprobe instances of the
      probed function and there will be no memory leak of kretprobe instances.
      Signed-off-by: default avatarbibo mao <bibo.mao@intel.com>
      Cc: Masami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c6fd91f0
    • Masami Hiramatsu's avatar
      [PATCH] kretprobe: kretprobe-booster · c9becf58
      Masami Hiramatsu authored
      In normal operation, kretprobe makes a target function return to trampoline
      code.  A kprobe (called trampoline_probe) has been inserted in the trampoline
      code.  When the kernel hits this kprobe, it calls kretprobe's handler and it
      returns to the original return address.
      
      Kretprobe-booster removes the trampoline_probe.  It allows the trampoline code
      to call kretprobe's handler directly instead of invoking kprobe.  The
      trampoline code returns to the original return address.
      
      (changelog from Chuck Ebbert <76306.1226@compuserve.com> - thanks ;))
      Signed-off-by: default avatarMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Chuck Ebbert <76306.1226@compuserve.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c9becf58
    • Masami Hiramatsu's avatar
      [PATCH] x86: kprobes-booster · 311ac88f
      Masami Hiramatsu authored
      Current kprobe copies the original instruction at the probe point and replaces
      it with a breakpoint instruction (int3).  When the kernel hits the probe
      point, kprobe handler is invoked.  And the copied instruction is single-step
      executed on the copied buffer (not on the original address) by kprobe.  After
      that, the kprobe checks registers and modify it (if need) as if the
      instructions was executed on the original address.
      
      My proposal is based on the fact there are many instructions which do NOT
      require the register modification after the single-step execution.  When the
      copied instruction is a kind of them, kprobe just jumps back to the next
      instruction after single-step execution.  If so, why don't we execute those
      instructions directly?
      
      With kprobe-booster patch, kprobes will execute a copied instruction directly
      and (if need) jump back to original code.  This direct execution is executed
      when the kprobe don't have both post_handler and break_handler, and the copied
      instruction can be executed directly.
      
      I sorted instructions which can be executed directly or not;
      
      - Call instructions are NG(can not be executed directly).
        We should correct the return address pushed into top of stack.
      - Indirect instructions except for absolute indirect-jumps
        are NG. Those instructions changes EIP randomly. We should
        check EIP and correct it.
      - Instructions that change EIP beyond the range of the
        instruction buffer are NG.
      - Instructions that change EIP to tail 5 bytes of the
        instruction buffer (it is the size of a jump instruction).
        We must write a jump instruction which backs to original
        kernel code in the instruction buffer.
      - Break point instruction is NG. We should not touch EIP and
        pass to other handlers.
      - Absolute direct/indirect jumps are OK.- Conditional Jumps are NG.
      - Halt and software-interruptions are NG. Because it will stay on
        the instruction buffer of kprobes.
      - Prefixes are NG.
      - Unknown/reserved opcode is NG.
      - Other 1 byte instructions are OK. But those instructions need a
        jump back code.
      - 2 bytes instructions are mapped sparsely. So, in this release,
        this patch don't boost those instructions.
      
      >From Intel's IA-32 opcode map described in IA-32 Intel Architecture Software
      Developer's Manual Vol.2 B, I determined that following opcodes are not
      boostable.
      
      - 0FH (2byte escape)
      - 70H - 7FH (Jump on condition)
      - 9AH (Call) and 9CH (Pushf)
      - C0H-C1H (Grp 2: includes reserved opcode)
      - C6H-C7H (Grp11: includes reserved opcode)
      - CCH-CEH (Software-interrupt)
      - D0H-D3H (Grp2: includes reserved opcode)
      - D6H (Reserved)
      - D8H-DFH (Coprocessor)
      - E0H-E3H (loop/conditional jump)
      - E8H (Call)
      - F0H-F3H (Prefixes and reserved)
      - F4H (Halt)
      - F6H-F7H (Grp3: includes reserved opcode)
      - FEH-FFH(Grp4,5: includes reserved opcode)
      
      Kprobe-booster checks whether target instruction can be boosted (can be
      executed directly) at arch_copy_kprobe() function.  If the target instruction
      can be boosted, it clears "boostable" flag.  If not, it sets "boostable" flag
      -1.  This is disabled status.  In resume_execution() function, If "boostable"
      flag is cleared, kprobe-booster measures the size of the target instruction
      and sets "boostable" flag 1.
      
      In kprobe_handler(), kprobe checks the "boostable" flag.  If the flag is 1, it
      resets current kprobe and executes instruction buffer directly instead of
      single stepping.
      
      When unregistering a boosted kprobe, it calls synchronize_sched()
      after "int3" is removed. So we can ensure followings after
      the synchronize_sched() called.
      - interrupt handlers are finished on all CPUs.
      - instruction buffer is not executed on all CPUs.
      And we can release the boosted kprobe safely.
      
      And also, on preemptible kernel, the booster is not enabled where the kernel
      preemption is enabled.  So, there are no preempted threads on the instruction
      buffer.
      
      The description of kretprobe-booster:
      ====================================
      
      In the normal operation, kretprobe make a target function return to trampoline
      code.  And a kprobe (called trampoline_probe) have been inserted at the
      trampoline code.  When the kernel hits this kprobe, it calls kretprobe's
      handler and it returns to original return address.
      
      Kretprobe-booster patch removes the trampoline_probe.  It allows the
      trampoline code to call kretprobe's handler directly instead of invoking
      kprobe.  And tranpoline code returns to original return address.
      
      This new trampoline code stores and restores registers, so the kretprobe
      handler is still able to access those registers.
      
      Current kprobe has about 1.3 usec/probe(*) overhead, and kprobe-booster patch
      reduces it to 0.6 usec/probe(*).  Also current kretprobe has about 2.0
      usec/probe(*) overhead.  Kprobe-booster patch reduces it to 1.3 usec/probe(*),
      and the combination of both kprobe-booster patch and kretprobe-booster patch
      reduces it to 0.9 usec/probe(*).
      
      I expect the combination of both patches can reduce half of a probing
      overhead.
      
      Performance numbers strongly depend on the processor model.
      
      Andrew Morton wrote:
      > These preempt tricks look rather nasty.  Can you please describe what the
      > problem is, precisely?  And how this code avoids it?  Perhaps we can find
      > something cleaner.
      
      The problem is how to remove the copied instructions of the
      kprobe *safely* on the preemptable kernel (CONFIG_PREEMPT=y).
      
      Kprobes basically executes the following actions;
      
      (1)int3
      (2)preempt_disable()
      (3)kprobe_prehandler()
      (4)copied instructioin(single step)
      (5)kprobe_posthandler()
      (6)preempt_enable()
      (7)return to the original code
      
      During the execution of copied instruction, preemption is
      disabled (from step (2) to (6)).
      When unregistering the probes, Kprobe waits for RCU
      quiescent state by using synchronize_sched() after removing
      int3 instruction.
      Thus we can ensure the copied instruction is not executed.
      
      On the other hand, kprobe-booster executes the following actions;
      
      (1)int3
      (2)preempt_disable()
      (3)kprobe_prehandler()
      (4)preempt_enable()             <-- this one is added by my patch
      (5)copied instruction(direct execution)
      (6)jmp back to the original code
      
      The problem is that we have no way to prevent preemption on
      step (5) or (6). We cannot call preempt_disable() after step (6),
      because there are no rooms to do that. Thus, some other
      processes may be preempted at step(5) or (6) on preemptable kernel.
      And I couldn't find the easy way to ensure that other processes'
      stack do *not* have the address of them. (I thought some way
      to do that, but those are very costly.)
      
      So currently, I simply boost the kprobe only when the probe
      point is already preemption disabled.
      
      > Also, the patch adds a preempt_enable() but I don't see a corresponding
      > preempt_disable().  Am I missing something?
      
      It is corresponding to the preempt_disable() in the top of
      kprobe_handler().
      I copied the code of kprobe_handler() here:
      
      static int __kprobes kprobe_handler(struct pt_regs *regs)
      {
              struct kprobe *p;
              int ret = 0;
              kprobe_opcode_t *addr = NULL;
              unsigned long *lp;
              struct kprobe_ctlblk *kcb;
      
              /*
               * We don't want to be preempted for the entire
               * duration of kprobe processing
               */
              preempt_disable();             <-- HERE
              kcb = get_kprobe_ctlblk();
      Signed-off-by: default avatarMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      311ac88f
    • Masami Hiramatsu's avatar
      [PATCH] kprobes: clean up resume_execute() · b50ea74c
      Masami Hiramatsu authored
      Clean up kprobe's resume_execute() for i386 arch.
      Signed-off-by: default avatarMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
      Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b50ea74c
    • Roman Zippel's avatar
      [PATCH] hrtimers: remove data field · 05cfb614
      Roman Zippel authored
      The nanosleep cleanup allows to remove the data field of hrtimer.  The
      callback function can use container_of() to get it's own data.  Since the
      hrtimer structure is anyway embedded in other structures, this adds no
      overhead.
      Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      05cfb614
    • Roman Zippel's avatar
      [PATCH] hrtimers: remove nsec_t typedef · df869b63
      Roman Zippel authored
      nsec_t predates ktime_t and has mostly been superseded by it.  In the few
      places that are left it's better to make it explicit that we're dealing with
      64 bit values here.
      Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      df869b63