1. 01 7月, 2013 1 次提交
  2. 20 6月, 2013 3 次提交
  3. 09 5月, 2013 1 次提交
  4. 04 4月, 2013 3 次提交
  5. 19 3月, 2013 1 次提交
  6. 12 3月, 2013 1 次提交
  7. 13 2月, 2013 1 次提交
  8. 16 1月, 2013 1 次提交
  9. 12 1月, 2013 1 次提交
    • S
      pstore: Avoid deadlock in panic and emergency-restart path · 9f244e9c
      Seiji Aguchi 提交于
      [Issue]
      
      When pstore is in panic and emergency-restart paths, it may be blocked
      in those paths because it simply takes spin_lock.
      
      This is an example scenario which pstore may hang up in a panic path:
      
       - cpuA grabs psinfo->buf_lock
       - cpuB panics and calls smp_send_stop
       - smp_send_stop sends IRQ to cpuA
       - after 1 second, cpuB gives up on cpuA and sends an NMI instead
       - cpuA is now in an NMI handler while still holding buf_lock
       - cpuB is deadlocked
      
      This case may happen if a firmware has a bug and
      cpuA is stuck talking with it more than one second.
      
      Also, this is a similar scenario in an emergency-restart path:
      
       - cpuA grabs psinfo->buf_lock and stucks in a firmware
       - cpuB kicks emergency-restart via either sysrq-b or hangcheck timer.
         And then, cpuB is deadlocked by taking psinfo->buf_lock again.
      
      [Solution]
      
      This patch avoids the deadlocking issues in both panic and emergency_restart
      paths by introducing a function, is_non_blocking_path(), to check if a cpu
      can be blocked in current path.
      
      With this patch, pstore is not blocked even if another cpu has
      taken a spin_lock, in those paths by changing from spin_lock_irqsave
      to spin_trylock_irqsave.
      
      In addition, according to a comment of emergency_restart() in kernel/sys.c,
      spin_lock shouldn't be taken in an emergency_restart path to avoid
      deadlock. This patch fits the comment below.
      
      <snip>
      /**
       *      emergency_restart - reboot the system
       *
       *      Without shutting down any hardware or taking any locks
       *      reboot the system.  This is called when we know we are in
       *      trouble so this is our best effort to reboot.  This is
       *      safe to call in interrupt context.
       */
      void emergency_restart(void)
      <snip>
      Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com>
      Acked-by: NDon Zickus <dzickus@redhat.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      9f244e9c
  10. 04 1月, 2013 1 次提交
    • G
      pstore: remove __dev* attributes. · f568f6ca
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit from the pstore filesystem.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Anton Vorontsov <cbouatmailru@gmail.com>
      Cc: Colin Cross <ccross@android.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f568f6ca
  11. 18 12月, 2012 1 次提交
  12. 13 12月, 2012 2 次提交
  13. 27 11月, 2012 2 次提交
    • S
      efi_pstore: Add a sequence counter to a variable name · 755d4fe4
      Seiji Aguchi 提交于
      [Issue]
      
      Currently, a variable name, which identifies each entry, consists of type, id and ctime.
      But if multiple events happens in a short time, a second/third event may fail to log because
      efi_pstore can't distinguish each event with current variable name.
      
      [Solution]
      
      A reasonable way to identify all events precisely is introducing a sequence counter to
      the variable name.
      
      The sequence counter has already supported in a pstore layer with "oopscount".
      So, this patch adds it to a variable name.
      Also, it is passed to read/erase callbacks of platform drivers in accordance with
      the modification of the variable name.
      
        <before applying this patch>
       a variable name of first event: dump-type0-1-12345678
       a variable name of second event: dump-type0-1-12345678
      
        type:0
        id:1
        ctime:12345678
      
       If multiple events happen in a short time, efi_pstore can't distinguish them because
       variable names are same among them.
      
        <after applying this patch>
      
       it can be distinguishable by adding a sequence counter as follows.
      
       a variable name of first event: dump-type0-1-1-12345678
       a variable name of Second event: dump-type0-1-2-12345678
      
        type:0
        id:1
        sequence counter: 1(first event), 2(second event)
        ctime:12345678
      
      In case of a write callback executed in pstore_console_write(), "0" is added to
      an argument of the write callback because it just logs all kernel messages and
      doesn't need to care about multiple events.
      Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NMike Waychison <mikew@google.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      755d4fe4
    • S
      efi_pstore: Add ctime to argument of erase callback · a9efd39c
      Seiji Aguchi 提交于
      [Issue]
      
      Currently, a variable name, which is used to identify each log entry, consists of type,
      id and ctime. But an erase callback does not use ctime.
      
      If efi_pstore supported just one log, type and id were enough.
      However, in case of supporting multiple logs, it doesn't work because
      it can't distinguish each entry without ctime at erasing time.
      
       <Example>
      
       As you can see below, efi_pstore can't differentiate first event from second one without ctime.
      
       a variable name of first event: dump-type0-1-12345678
       a variable name of second event: dump-type0-1-23456789
      
        type:0
        id:1
        ctime:12345678, 23456789
      
      [Solution]
      
      This patch adds ctime to an argument of an erase callback.
      
      It works across reboots because ctime of pstore means the date that the record was originally stored.
      To do this, efi_pstore saves the ctime to variable name at writing time and passes it to pstore
      at reading time.
      Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com>
      Acked-by: NMike Waychison <mikew@google.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      a9efd39c
  14. 18 11月, 2012 1 次提交
  15. 17 11月, 2012 1 次提交
  16. 15 11月, 2012 1 次提交
  17. 21 9月, 2012 1 次提交
  18. 07 9月, 2012 1 次提交
    • A
      pstore/ftrace: Convert to its own enable/disable debugfs knob · 65f8c95e
      Anton Vorontsov 提交于
      With this patch we no longer reuse function tracer infrastructure, now
      we register our own tracer back-end via a debugfs knob.
      
      It's a bit more code, but that is the only downside. On the bright side we
      have:
      
      - Ability to make persistent_ram module removable (when needed, we can
        move ftrace_ops struct into a module). Note that persistent_ram is still
        not removable for other reasons, but with this patch it's just one
        thing less to worry about;
      
      - Pstore part is more isolated from the generic function tracer. We tried
        it already by registering our own tracer in available_tracers, but that
        way we're loosing ability to see the traces while we record them to
        pstore. This solution is somewhere in the middle: we only register
        "internal ftracer" back-end, but not the "front-end";
      
      - When there is only pstore tracing enabled, the kernel will only write
        to the pstore buffer, omitting function tracer buffer (which, of course,
        still can be enabled via 'echo function > current_tracer').
      Suggested-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      65f8c95e
  19. 01 9月, 2012 1 次提交
  20. 05 8月, 2012 3 次提交
    • A
      pstore/ram: Mark ramoops_pstore_write_buf() as notrace · 24203036
      Anton Vorontsov 提交于
      write_buf() should be marked as notrace, otherwise it is prone to
      recursion.
      
      Though, yet the issue is never triggered in real life, because we run
      inside the function tracer, where ftrace does its own recurse protection.
      
      But it's still no good, plus soon we might switch to our own tracer ops,
      and then the issue will be fatal. So, let's fix it.
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      24203036
    • R
      pstore/ram: Fix printk format warning · 0427193b
      Randy Dunlap 提交于
      Fix printk format warning (on i386) in pstore:
      
      fs/pstore/ram.c:409:3: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'size_t'
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      0427193b
    • A
      pstore/ram: Fix possible NULL dereference · a384f641
      Anton Vorontsov 提交于
      We can dereference 'cxt->cprz' if console and dump logging are disabled
      (which is unlikely, but still possible to do). This patch fixes the issue
      by changing the code so that we don't dereference przs at all, we can
      just calculate bufsize from console_size and record_size values.
      
      Plus, while at it, the patch improves the buffer size calculation.
      
      After Kay's printk rework, we know the optimal buffer size for console
      logging -- it is LOG_LINE_MAX (defined privately in printk.c). Previously,
      if only console logging was enabled, we would allocate unnecessary large
      buffer in pstore, while we only need LOG_LINE_MAX. (Pstore console logging
      is still capable of handling buffers > LOG_LINE_MAX, it will just do
      multiple calls to psinfo->write).
      
      Note that I don't export the constant, since we will do even a better
      thing soon: we will switch console logging to a new write_buf API, which
      will eliminate the need for the additional buffer; and so we won't need
      the constant.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      Acked-by: NKees Cook <keescook@chromium.org>
      a384f641
  21. 18 7月, 2012 9 次提交
  22. 21 6月, 2012 3 次提交