1. 21 5月, 2010 15 次提交
    • J
      kdb,debug_core: Allow the debug core to receive a panic notification · 4402c153
      Jason Wessel 提交于
      It is highly desirable to trap into kdb on panic.  The debug core will
      attempt to register as the first in line for the panic notifier.
      
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Eric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      4402c153
    • J
      debug_core,kdb: Allow the debug core to process a recursive debug entry · 6d906340
      Jason Wessel 提交于
      This allows kdb to debug a crash with in the kms code with a
      single level recursive re-entry.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      6d906340
    • J
      printk,kdb: capture printk() when in kdb shell · d37d39ae
      Jason Wessel 提交于
      Certain calls from the kdb shell will call out to printk(), and any of
      these calls should get vectored back to the kdb_printf() so that the
      kdb pager and processing can be used, as well as to properly channel
      I/O to the polled I/O devices.
      
      CC: Randy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NAndrew Morton <akpm@linux-foundation.org>
      d37d39ae
    • J
      kgdboc,kdb: Allow kdb to work on a non open console port · efe2f29e
      Jason Wessel 提交于
      If kdb is open on a serial port that is not actually a console make
      sure to call the poll routines to emit and receive characters.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NMartin Hicks <mort@sgi.com>
      efe2f29e
    • J
      kgdb: Add the ability to schedule a breakpoint via a tasklet · 1cee5e35
      Jason Wessel 提交于
      Some kgdb I/O modules require the ability to create a breakpoint
      tasklet, such as kgdboc and external modules such as kgdboe.  The
      breakpoint tasklet is used as an asynchronous entry point into the
      debugger which will have a different function scope than the current
      execution path where it might not be safe to have an inline
      breakpoint.  This is true of some of the kgdb I/O drivers which share
      code with kgdb and rest of the kernel users.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      1cee5e35
    • J
      x86,kgdb: Add low level debug hook · f503b5ae
      Jason Wessel 提交于
      The only way the debugger can handle a trap in inside rcu_lock,
      notify_die, or atomic_notifier_call_chain without a triple fault is
      to have a low level "first opportunity handler" in the int3 exception
      handler.
      
      Generally this will be something the vast majority of folks will not
      need, but for those who need it, it is added as a kernel .config
      option called KGDB_LOW_LEVEL_TRAP.
      
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: H. Peter Anvin <hpa@zytor.com>
      CC: x86@kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      f503b5ae
    • J
      kgdb: remove post_primary_code references · 98ec1878
      Jason Wessel 提交于
      Remove all the references to the kgdb_post_primary_code.  This
      function serves no useful purpose because you can obtain the same
      information from the "struct kgdb_state *ks" from with in the
      debugger, if for some reason you want the data.
      
      Also remove the unintentional duplicate assignment for ks->ex_vector.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      98ec1878
    • J
      kgdboc,keyboard: Keyboard driver for kdb with kgdb · ada64e4c
      Jason Wessel 提交于
      This patch adds in the kdb PS/2 keyboard driver.  This was mostly a
      direct port from the original kdb where I cleaned up the code against
      checkpatch.pl and added the glue to stitch it into kgdb.
      
      This patch also enables early kdb debug via kgdbwait and the keyboard.
      
      All the access to configure kdb using either a serial console or the
      keyboard is done via kgdboc.
      
      If you want to use only the keyboard and want to break in early you
      would add to your kernel command arguments:
      
          kgdboc=kbd kgdbwait
      
      If you wanted serial and or the keyboard access you could use:
      
          kgdboc=kbd,ttyS0
      
      You can also configure kgdboc as a kernel module or at run time with
      the sysfs where you can activate and deactivate kgdb.
      
      Turn it on:
          echo kbd,ttyS0 > /sys/module/kgdboc/parameters/kgdboc
      
      Turn it off:
          echo "" > /sys/module/kgdboc/parameters/kgdboc
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Reviewed-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      ada64e4c
    • J
      kgdb: gdb "monitor" -> kdb passthrough · a0de055c
      Jason Wessel 提交于
      One of the driving forces behind integrating another front end (kdb)
      to the debug core is to allow front end commands to be accessible via
      gdb's monitor command.  It is true that you could write gdb macros to
      get certain data, but you may want to just use gdb to access the
      commands that are available in the kdb front end.
      
      This patch implements the Rcmd gdb stub packet.  In gdb you access
      this with the "monitor" command.  For instance you could type "monitor
      help", "monitor lsmod" or "monitor ps A" etc...
      
      There is no error checking or command restrictions on what you can and
      cannot access at this point.  Doing something like trying to set
      breakpoints with the monitor command is going to cause nothing but
      problems.  Perhaps in the future only the commands that are actually
      known to work with the gdb monitor command will be available.
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      a0de055c
    • J
      kgdb,8250,pl011: Return immediately from console poll · f5316b4a
      Jason Wessel 提交于
      The design of the kdb shell requires that every device that can
      provide input to kdb have a polling routine that exits immediately if
      there is no character available.  This is required in order to get the
      page scrolling mechanism working.
      
      Changing the kernel debugger I/O API to require all polling character
      routines to exit immediately if there is no data allows the kernel
      debugger to process multiple input channels.
      
      NO_POLL_CHAR will be the return code to the polling routine when ever
      there is no character available.
      
      CC: linux-serial@vger.kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      f5316b4a
    • J
      kgdb: core changes to support kdb · dcc78711
      Jason Wessel 提交于
      These are the minimum changes to the kgdb core in order to enable an
      API to connect a new front end (kdb) to the debug core.
      
      This patch introduces the dbg_kdb_mode variable controls where the
      user level I/O is routed.  It will be routed to the gdbstub (kgdb) or
      to the kdb front end which is a simple shell available over the kgdboc
      connection.
      
      You can switch back and forth between kdb or the gdb stub mode of
      operation dynamically.  From gdb stub mode you can blindly type
      "$3#33", or from the kdb mode you can enter "kgdb" to switch to the
      gdb stub.
      
      The logic in the debug core depends on kdb to look for the typical gdb
      connection sequences and return immediately with KGDB_PASS_EVENT if a
      gdb serial command sequence is detected.  That should allow a
      reasonably seamless transition between kdb -> gdb without leaving the
      kernel exception state.  The two gdb serial queries that kdb is
      responsible for detecting are the "?" and "qSupported" packets.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NMartin Hicks <mort@sgi.com>
      dcc78711
    • J
      kdb: core for kgdb back end (2 of 2) · 67fc4e0c
      Jason Wessel 提交于
      This patch contains the hooks and instrumentation into kernel which
      live outside the kernel/debug directory, which the kdb core
      will call to run commands like lsmod, dmesg, bt etc...
      
      CC: linux-arch@vger.kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NMartin Hicks <mort@sgi.com>
      67fc4e0c
    • J
      kdb: core for kgdb back end (1 of 2) · 5d5314d6
      Jason Wessel 提交于
      This patch contains only the kdb core.  Because the change set was
      large, it was split.  The next patch in the series includes the
      instrumentation into the core kernel which are mainly helper functions
      for kdb.
      
      This work is directly derived from kdb v4.4 found at:
      
      ftp://oss.sgi.com/projects/kdb/download/v4.4/
      
      The kdb internals have been re-organized to make them mostly platform
      independent and to connect everything to the debug core which is used by
      gdbstub (which has long been known as kgdb).
      
      The original version of kdb was 58,000 lines worth of changes to
      support x86.  From that implementation only the kdb shell, and basic
      commands for memory access, runcontrol, lsmod, and dmesg where carried
      forward.
      
      This is a generic implementation which aims to cover all the current
      architectures using the kgdb core: ppc, arm, x86, mips, sparc, sh and
      blackfin.  More archictectures can be added by implementing the
      architecture specific kgdb functions.
      
      [mort@sgi.com: Compile fix with hugepages enabled]
      [mort@sgi.com: Clean breakpoint code renaming kdba_ -> kdb_]
      [mort@sgi.com: fix new line after printing registers]
      [mort@sgi.com: Remove the concept of global vs. local breakpoints]
      [mort@sgi.com: Rework kdb_si_swapinfo to use more generic name]
      [mort@sgi.com: fix the information dump macros, remove 'arch' from the names]
      [sfr@canb.auug.org.au: include fixup to include linux/slab.h]
      
      CC: linux-arch@vger.kernel.org
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NMartin Hicks <mort@sgi.com>
      5d5314d6
    • J
      Separate the gdbstub from the debug core · 53197fc4
      Jason Wessel 提交于
      Split the former kernel/kgdb.c into debug_core.c which contains the
      kernel debugger exception logic and to the gdbstub.c which contains
      the logic for allowing gdb to talk to the debug core.
      
      This also created a private include file called debug_core.h which
      contains all the definitions to glue the debug_core to any other
      debugger connections.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      53197fc4
    • J
      Move kernel/kgdb.c to kernel/debug/debug_core.c · c4338209
      Jason Wessel 提交于
      Move kgdb.c in preparation to separate the gdbstub from the debug
      core and exception handling.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      c4338209
  2. 20 5月, 2010 1 次提交
    • K
      cpumask: fix compat getaffinity · fa9dc265
      KOSAKI Motohiro 提交于
      Commit a45185d2 "cpumask: convert kernel/compat.c" broke libnuma, which
      abuses sched_getaffinity to find out NR_CPUS in order to parse
      /sys/devices/system/node/node*/cpumap.
      
      On NUMA systems with less than 32 possibly CPUs, the current
      compat_sys_sched_getaffinity now returns '4' instead of the actual
      NR_CPUS/8, which makes libnuma bail out when parsing the cpumap.
      
      The libnuma call sched_getaffinity(0, bitmap, 4096) at first.  It mean
      the libnuma expect the return value of sched_getaffinity() is either len
      argument or NR_CPUS.  But it doesn't expect to return nr_cpu_ids.
      
      Strictly speaking, userland requirement are
      
      1) Glibc assume the return value mean the lengh of initialized
         of mask argument. E.g. if sched_getaffinity(1024) return 128,
         glibc make zero fill rest 896 byte.
      2) Libnuma assume the return value can be used to guess NR_CPUS
         in kernel. It assume len-arg<NR_CPUS makes -EINVAL. But
         it try len=4096 at first and 4096 is always bigger than
         NR_CPUS. Then, if we remove strange min_length normalization,
         we never hit -EINVAL case.
      
      sched_getaffinity() already solved this issue.  This patch adapts
      compat_sys_sched_getaffinity() to match the non-compat case.
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Reported-by: NKen Werner <ken.werner@web.de>
      Cc: stable@kernel.org
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fa9dc265
  3. 18 5月, 2010 1 次提交
  4. 17 5月, 2010 2 次提交
    • H
      [S390] debug: enable exception-trace debug facility · ab3c68ee
      Heiko Carstens 提交于
      The exception-trace facility on x86 and other architectures prints
      traces to dmesg whenever a user space application crashes.
      s390 has such a feature since ages however it is called
      userprocess_debug and is enabled differently.
      This patch makes sure that whenever one of the two procfs files
      
      /proc/sys/kernel/userprocess_debug
      /proc/sys/debug/exception-trace
      
      is modified the contents of the second one changes as well.
      That way we keep backwards compatibilty but also support the same
      interface like other architectures do.
      Besides that the output of the traces is improved since it will now
      also contain the corresponding filename of the vma (when available)
      where the process caused a fault or trap.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      ab3c68ee
    • M
      PM: PM QOS update fix · 25f3a5a2
      Mark Gross 提交于
      This update handles a use case where pm_qos update requests need to
      silently fail if the update is being sent to a handle that is NULL.
      
      The problem was that the original pm_qos silently fails when a request
      update is passed to a parameter that has not been added to the list yet.
      This update restores that behavior.
      Signed-off-by: Nmarkgross <markgross@thegnar.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      25f3a5a2
  5. 15 5月, 2010 1 次提交
  6. 12 5月, 2010 7 次提交
    • P
      genirq: Clear CPU mask in affinity_hint when none is provided · 4308ad80
      Peter P Waskiewicz Jr 提交于
      When an interrupt is disabled and torn down, the CPU mask returned
      through affinity_hint right now is all CPUs. Also, for drivers that
      don't provide an affinity_hint mask, this can be misleading. There
      should be no hint at all, meaning an empty CPU mask.
      
      [ tglx: use zalloc_cpumask_var instead of clearing it under the lock ]
      Signed-off-by: NPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
      Cc: davem@davemloft.net
      Cc: arjan@linux.jf.intel.com
      Cc: bhutchings@solarflare.com
      LKML-Reference: <20100505205638.5426.87189.stgit@ppwaskie-hc2.jf.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      4308ad80
    • K
      memcg: fix css_is_ancestor() RCU locking · 747388d7
      KAMEZAWA Hiroyuki 提交于
      Some callers (in memcontrol.c) calls css_is_ancestor() without
      rcu_read_lock.  Because css_is_ancestor() has to access RCU protected
      data, it should be under rcu_read_lock().
      
      This makes css_is_ancestor() itself does safe access to RCU protected
      area.  (At least, "root" can have refcnt==0 if it's not an ancestor of
      "child".  So, we need rcu_read_lock().)
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
      Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      747388d7
    • K
      memcg: fix css_id() RCU locking for real · 7f0f1546
      KAMEZAWA Hiroyuki 提交于
      Commit ad4ba375 ("memcg: css_id() must be
      called under rcu_read_lock()") modifies memcontol.c for fixing RCU check
      message.  But Andrew Morton pointed out that the fix doesn't seems sane
      and it was just for hidining lockdep messages.
      
      This is a patch for do proper things.  Checking again, all places,
      accessing without rcu_read_lock, that commit fixies was intentional....
      all callers of css_id() has reference count on it.  So, it's not necessary
      to be under rcu_read_lock().
      
      Considering again, we can use rcu_dereference_check for css_id().  We know
      css->id is valid if css->refcnt > 0.  (css->id never changes and freed
      after css->refcnt going to be 0.)
      
      This patch makes use of rcu_dereference_check() in css_id/depth and remove
      unnecessary rcu-read-lock added by the commit.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
      Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7f0f1546
    • V
      bsdacct: use del_timer_sync() in acct_exit_ns() · 11cad320
      Vitaliy Gusev 提交于
      acct_exit_ns --> acct_file_reopen deletes timer without check timer
      execution on other CPUs.  So acct_timeout() can change an unmapped memory.
      Signed-off-by: NVitaliy Gusev <vgusev@openvz.org>
      Cc: Pavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      11cad320
    • V
      kexec: fix OOPS in crash_kernel_shrink · 475f9aa6
      Vitaly Mayatskikh 提交于
      Two "echo 0 > /sys/kernel/kexec_crash_size" OOPSes kernel.  Also content
      of this file is invalid after first shrink to zero: it shows 1 instead of
      0.
      
      This scenario is unlikely to happen often (root privs, valid crashkernel=
      in cmdline, dump-capture kernel not loaded), I hit it only by chance.
      
      This patch fixes it.
      Signed-off-by: NVitaly Mayatskikh <v.mayatskih@gmail.com>
      Cc: Cong Wang <amwang@redhat.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      475f9aa6
    • R
      revert "procfs: provide stack information for threads" and its fixup commits · 34441427
      Robin Holt 提交于
      Originally, commit d899bf7b ("procfs: provide stack information for
      threads") attempted to introduce a new feature for showing where the
      threadstack was located and how many pages are being utilized by the
      stack.
      
      Commit c44972f1 ("procfs: disable per-task stack usage on NOMMU") was
      applied to fix the NO_MMU case.
      
      Commit 89240ba0 ("x86, fs: Fix x86 procfs stack information for threads on
      64-bit") was applied to fix a bug in ia32 executables being loaded.
      
      Commit 9ebd4eba ("procfs: fix /proc/<pid>/stat stack pointer for kernel
      threads") was applied to fix a bug which had kernel threads printing a
      userland stack address.
      
      Commit 1306d603 ('proc: partially revert "procfs: provide stack
      information for threads"') was then applied to revert the stack pages
      being used to solve a significant performance regression.
      
      This patch nearly undoes the effect of all these patches.
      
      The reason for reverting these is it provides an unusable value in
      field 28.  For x86_64, a fork will result in the task->stack_start
      value being updated to the current user top of stack and not the stack
      start address.  This unpredictability of the stack_start value makes
      it worthless.  That includes the intended use of showing how much stack
      space a thread has.
      
      Other architectures will get different values.  As an example, ia64
      gets 0.  The do_fork() and copy_process() functions appear to treat the
      stack_start and stack_size parameters as architecture specific.
      
      I only partially reverted c44972f1 ("procfs: disable per-task stack usage
      on NOMMU") .  If I had completely reverted it, I would have had to change
      mm/Makefile only build pagewalk.o when CONFIG_PROC_PAGE_MONITOR is
      configured.  Since I could not test the builds without significant effort,
      I decided to not change mm/Makefile.
      
      I only partially reverted 89240ba0 ("x86, fs: Fix x86 procfs stack
      information for threads on 64-bit") .  I left the KSTK_ESP() change in
      place as that seemed worthwhile.
      Signed-off-by: NRobin Holt <holt@sgi.com>
      Cc: Stefani Seibold <stefani@seibold.net>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34441427
    • P
      rcu: remove all rcu head initializations, except on_stack initializations · 72d5a9f7
      Paul E. McKenney 提交于
      Remove all rcu head inits. We don't care about the RCU head state before passing
      it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
      keep track of objects on stack.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      72d5a9f7
  7. 11 5月, 2010 13 次提交