1. 14 3月, 2010 18 次提交
  2. 13 3月, 2010 22 次提交
    • B
      x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems · 0e152cd7
      Borislav Petkov 提交于
      de957628 changed setting of the
      x86_init.iommu.iommu_init function ptr only when GART IOMMU is
      found.
      
      One side effect of it is that num_k8_northbridges
      is not initialized anymore if not explicitly
      called. This resulted in uninitialized pointers in
      <arch/x86/kernel/cpu/intel_cacheinfo.c:amd_calc_l3_indices()>,
      for example, which uses the num_k8_northbridges thing through
      node_to_k8_nb_misc().
      
      Fix that through an initcall that runs right after the PCI
      subsystem and does all the scanning. Then, remove initialization
      in gart_iommu_init() which is a rootfs_initcall and we're
      running before that.
      
      What is more, since num_k8_northbridges is being used in other
      places beside GART IOMMU, include it whenever we add AMD CPU
      support. The previous dependency chain in kconfig contained
      
      K8_NB depends on AGP_AMD64|GART_IOMMU
      
      which was clearly incorrect. The more natural way in terms of
      hardware dependency should be
      
      AGP_AMD64|GART_IOMMU depends on K8_NB depends on CPU_SUP_AMD &&
      PCI. Make it so Number One!
      Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      LKML-Reference: <20100312144303.GA29262@aftab>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Tested-by: NJoerg Roedel <joerg.roedel@amd.com>
      0e152cd7
    • S
      tracing: Do not record user stack trace from NMI context · b6345879
      Steven Rostedt 提交于
      A bug was found with Li Zefan's ftrace_stress_test that caused applications
      to segfault during the test.
      
      Placing a tracing_off() in the segfault code, and examining several
      traces, I found that the following was always the case. The lock tracer
      was enabled (lockdep being required) and userstack was enabled. Testing
      this out, I just enabled the two, but that was not good enough. I needed
      to run something else that could trigger it. Running a load like hackbench
      did not work, but executing a new program would. The following would
      trigger the segfault within seconds:
      
        # echo 1 > /debug/tracing/options/userstacktrace
        # echo 1 > /debug/tracing/events/lock/enable
        # while :; do ls > /dev/null ; done
      
      Enabling the function graph tracer and looking at what was happening
      I finally noticed that all cashes happened just after an NMI.
      
       1)               |    copy_user_handle_tail() {
       1)               |      bad_area_nosemaphore() {
       1)               |        __bad_area_nosemaphore() {
       1)               |          no_context() {
       1)               |            fixup_exception() {
       1)   0.319 us    |              search_exception_tables();
       1)   0.873 us    |            }
      [...]
       1)   0.314 us    |  __rcu_read_unlock();
       1)   0.325 us    |    native_apic_mem_write();
       1)   0.943 us    |  }
       1)   0.304 us    |  rcu_nmi_exit();
      [...]
       1)   0.479 us    |  find_vma();
       1)               |  bad_area() {
       1)               |    __bad_area() {
      
      After capturing several traces of failures, all of them happened
      after an NMI. Curious about this, I added a trace_printk() to the NMI
      handler to read the regs->ip to see where the NMI happened. In which I
      found out it was here:
      
      ffffffff8135b660 <page_fault>:
      ffffffff8135b660:       48 83 ec 78             sub    $0x78,%rsp
      ffffffff8135b664:       e8 97 01 00 00          callq  ffffffff8135b800 <error_entry>
      
      What was happening is that the NMI would happen at the place that a page
      fault occurred. It would call rcu_read_lock() which was traced by
      the lock events, and the user_stack_trace would run. This would trigger
      a page fault inside the NMI. I do not see where the CR2 register is
      saved or restored in NMI handling. This means that it would corrupt
      the page fault handling that the NMI interrupted.
      
      The reason the while loop of ls helped trigger the bug, was that
      each execution of ls would cause lots of pages to be faulted in, and
      increase the chances of the race happening.
      
      The simple solution is to not allow user stack traces in NMI context.
      After this patch, I ran the above "ls" test for a couple of hours
      without any issues. Without this patch, the bug would trigger in less
      than a minute.
      
      Cc: stable@kernel.org
      Reported-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      b6345879
    • S
      tracing: Disable buffer switching when starting or stopping trace · a2f80714
      Steven Rostedt 提交于
      When the trace iterator is read, tracing_start() and tracing_stop()
      is called to stop tracing while the iterator is processing the trace
      output.
      
      These functions disable both the standard buffer and the max latency
      buffer. But if the wakeup tracer is running, it can switch these
      buffers between the two disables:
      
        buffer = global_trace.buffer;
        if (buffer)
            ring_buffer_record_disable(buffer);
      
            <<<--------- swap happens here
      
        buffer = max_tr.buffer;
        if (buffer)
            ring_buffer_record_disable(buffer);
      
      What happens is that we disabled the same buffer twice. On tracing_start()
      we can enable the same buffer twice. All ring_buffer_record_disable()
      must be matched with a ring_buffer_record_enable() or the buffer
      can be disable permanently, or enable prematurely, and cause a bug
      where a reset happens while a trace is commiting.
      
      This patch protects these two by taking the ftrace_max_lock to prevent
      a switch from occurring.
      
      Found with Li Zefan's ftrace_stress_test.
      
      Cc: stable@kernel.org
      Reported-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      a2f80714
    • S
      tracing: Use same local variable when resetting the ring buffer · 283740c6
      Steven Rostedt 提交于
      In the ftrace code that resets the ring buffer it references the
      buffer with a local variable, but then uses the tr->buffer as the
      parameter to reset. If the wakeup tracer is running, which can
      switch the tr->buffer with the max saved buffer, this can break
      the requirement of disabling the buffer before the reset.
      
         buffer = tr->buffer;
         ring_buffer_record_disable(buffer);
         synchronize_sched();
         __tracing_reset(tr->buffer, cpu);
      
      If the tr->buffer is swapped, then the reset is not happening to the
      buffer that was disabled. This will cause the ring buffer to fail.
      
      Found with Li Zefan's ftrace_stress_test.
      
      Cc: stable@kernel.org
      Reported-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      283740c6
    • S
      function-graph: Init curr_ret_stack with ret_stack · ea14eb71
      Steven Rostedt 提交于
      If the graph tracer is active, and a task is forked but the allocating of
      the processes graph stack fails, it can cause crash later on.
      
      This is due to the temporary stack being NULL, but the curr_ret_stack
      variable is copied from the parent. If it is not -1, then in
      ftrace_graph_probe_sched_switch() the following:
      
      	for (index = next->curr_ret_stack; index >= 0; index--)
      		next->ret_stack[index].calltime += timestamp;
      
      Will cause a kernel OOPS.
      
      Found with Li Zefan's ftrace_stress_test.
      
      Cc: stable@kernel.org
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      ea14eb71
    • L
      ring-buffer: Move disabled check into preempt disable section · 52fbe9cd
      Lai Jiangshan 提交于
      The ring buffer resizing and resetting relies on a schedule RCU
      action. The buffers are disabled, a synchronize_sched() is called
      and then the resize or reset takes place.
      
      But this only works if the disabling of the buffers are within the
      preempt disabled section, otherwise a window exists that the buffers
      can be written to while a reset or resize takes place.
      
      Cc: stable@kernel.org
      Reported-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B949E43.2010906@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      52fbe9cd
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · daf9fe2e
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
        mfd: Several MFD drivers should depend on GENERIC_HARDIRQS
        mfd: Fix sm501 requested region size
      daf9fe2e
    • L
      9d85929f
    • L
      Fix up .gitignore for top-level file patterns · 6db823cf
      Linus Torvalds 提交于
      Some of the gitignore file patters were explicitly meant to be only for
      the top level, but weren't marked that way, so they would trigger
      recursively in subdirectories too.  Normally that was harmless, but at
      least "linux" happened to trigger elsewhere too. Fix it up.
      
      And other patterns in that section weren't necessarily top-level at all.
      Reported-by: NJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6db823cf
    • L
      Merge branch 'timers-fixes-for-linus' of... · 64d5aea3
      Linus Torvalds 提交于
      Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        timekeeping: Prevent oops when GENERIC_TIME=n
      64d5aea3
    • E
      anon_inodes: mark the anon inode private · 3836a03d
      Eric Paris 提交于
      Inotify was switched to use anon_inode instead of its own private filesystem
      which only had one inode in commit c44dcc56 "switch inotify_user to
      anon_inode"
      
      The problem with this is that now the inotify inode is not a distinct inode
      which can be managed by LSMs.  userspace tools which use inotify were allowed
      to use the inotify inode but may not have had permission to do read/write type
      operations on the anon_inode.  After looking at the anon_inode and its users
      it looks like the best solution is to just mark the anon_inode as S_PRIVATE
      so the security system will ignore it.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3836a03d
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6 · 83c0fb65
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
        udf: use ext2_find_next_bit
        udf: Do not read inode before writing it
        udf: Fix unalloc space handling in udf_update_inode
      83c0fb65
    • L
      Merge branch 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msm · 11bfe2ea
      Linus Torvalds 提交于
      * 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msm:
        msm_sdcc.c: missing brackets in msmsdcc_resume()
      11bfe2ea
    • L
      locking: Make sparse work with inline spinlocks and rwlocks · b97c4bc1
      Luca Barbieri 提交于
      Currently sparse does not work with inline spinlock and rwlock functions. 
      The problem is that they do not use the __acquires/__releases out-of-line
      functions, but use inline functions with no sparse annotations.
      
      This patch adds the appropriate annotations to make it work properly.
      Signed-off-by: NLuca Barbieri <luca@luca-barbieri.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b97c4bc1
    • L
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · b6fedfd2
      Linus Torvalds 提交于
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/booke: Fix breakpoint/watchpoint one-shot behavior
        powerpc: Reduce printk from pseries_mach_cpu_die()
        powerpc: Move checks in pseries_mach_cpu_die()
        powerpc: Reset kernel stack on cpu online from cede state
        powerpc: Fix G5 thermal shutdown
        powerpc/pseries: Pass CPPR value to H_XIRR hcall
        powerpc/booke: Fix a couple typos in the advanced ptrace code
        powerpc: Fix SMP build with disabled CPU hotplugging.
        powerpc: Dynamically allocate pacas
        powerpc/perf: e500 support
        powerpc/perf: Build callchain code regardless of hardware event support.
        powerpc/cpm2: Checkpatch cleanup
        powerpc/86xx: Renaming following split of GE Fanuc joint venture
        powerpc/86xx: Convert gef_pic_lock to raw_spinlock
        powerpc/qe: Convert qe_ic_lock to raw_spinlock
        powerpc/82xx: Convert pci_pic_lock to raw_spinlock
        powerpc/85xx: Convert socrates_fpga_pic_lock to raw_spinlock
      b6fedfd2
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial · c32da023
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (56 commits)
        doc: fix typo in comment explaining rb_tree usage
        Remove fs/ntfs/ChangeLog
        doc: fix console doc typo
        doc: cpuset: Update the cpuset flag file
        Fix of spelling in arch/sparc/kernel/leon_kernel.c no longer needed
        Remove drivers/parport/ChangeLog
        Remove drivers/char/ChangeLog
        doc: typo - Table 1-2 should refer to "status", not "statm"
        tree-wide: fix typos "ass?o[sc]iac?te" -> "associate" in comments
        No need to patch AMD-provided drivers/gpu/drm/radeon/atombios.h
        devres/irq: Fix devm_irq_match comment
        Remove reference to kthread_create_on_cpu
        tree-wide: Assorted spelling fixes
        tree-wide: fix 'lenght' typo in comments and code
        drm/kms: fix spelling in error message
        doc: capitalization and other minor fixes in pnp doc
        devres: typo fix s/dev/devm/
        Remove redundant trailing semicolons from macros
        fix typo "definetly" -> "definitely" in comment
        tree-wide: s/widht/width/g typo in comments
        ...
      
      Fix trivial conflict in Documentation/laptops/00-INDEX
      c32da023
    • L
      Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm · dca1d9f6
      Linus Torvalds 提交于
      * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (370 commits)
        ARM: S3C2443: Add set_rate and round_rate calls for armdiv clock
        ARM: S3C2443: Remove #if 0 for clk_mpll
        ARM: S3C2443: Update notes on MPLLREF clock
        ARM: S3C2443: Further clksrc-clk conversions
        ARM: S3C2443: Change to using plat-samsung clksrc-clk implementation
        USB: Fix s3c-hsotg build following Samsung platform header moves
        ARM: S3C64XX: Reintroduce unconditional build of audio device
        ARM: 5961/1: ux500: fix CLKRST addresses
        ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted
        ASoC: Fix S3C64xx IIS driver for Samsung header reorg
        ARM: S3C2440: Fix plat-s3c24xx move of s3c2440/s3c2442 support
        [ARM] pxa: fix typo in mxm8x10.h
        [ARM] pxa/raumfeld: set GPIO drive bits for LED pins
        [ARM] pxa/zeus: Add support for mcp2515 CAN bus
        [ARM] pxa/zeus: Add support for onboard max6369 watchdog
        [ARM] pxa/zeus: Add Eurotech as the manufacturer
        [ARM] pxa/zeus: Correct the USB host initialisation flags
        [ARM] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
        [ARM] pxa: refactor uncompress.h for non-PXA uarts
        [ARM] mmp2: fix incorrect calling of chip->mask_ack() for 2nd level cascaded IRQs
        ...
      dca1d9f6
    • D
      sysctl extern cleanup: poll · 9ff99339
      Dave Young 提交于
      Extern declarations in sysctl.c should be moved to their own header file,
      and then include them in relavant .c files.
      
      Move epoll_table extern declaration to linux/poll.h
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ff99339
    • D
      sysctl extern cleanup: lockdep · 2edf5e49
      Dave Young 提交于
      Extern declarations in sysctl.c should be moved to their own header file,
      and then include them in relavant .c files.
      
      Move lockdep extern declarations to linux/lockdep.h
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2edf5e49
    • D
      sysctl extern cleanup: rtmutex · 4f0e056f
      Dave Young 提交于
      Extern declarations in sysctl.c should be moved to their own header file,
      and then include them in relavant .c files.
      
      Move max_lock_depth extern declaration to linux/rtmutex.h
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4f0e056f
    • D
      sysctl extern cleanup: acct · c55b7c3e
      Dave Young 提交于
      Extern declarations in sysctl.c should be moved to their own header file,
      and then include them in relavant .c files.
      
      Move acct_parm extern declaration to linux/acct.h
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c55b7c3e
    • D
      sysctl extern cleanup: sg · 15485a46
      Dave Young 提交于
      Extern declarations in sysctl.c should be moved to their own header file,
      and then include them in relavant .c files.
      
      Move sg_big_buff extern declaration to scsi/sg.h
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Acked-by: NDoug Gilbert <dgilbert@interlog.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      15485a46