1. 08 10月, 2013 1 次提交
    • A
      net: fix unsafe set_memory_rw from softirq · d45ed4a4
      Alexei Starovoitov 提交于
      on x86 system with net.core.bpf_jit_enable = 1
      
      sudo tcpdump -i eth1 'tcp port 22'
      
      causes the warning:
      [   56.766097]  Possible unsafe locking scenario:
      [   56.766097]
      [   56.780146]        CPU0
      [   56.786807]        ----
      [   56.793188]   lock(&(&vb->lock)->rlock);
      [   56.799593]   <Interrupt>
      [   56.805889]     lock(&(&vb->lock)->rlock);
      [   56.812266]
      [   56.812266]  *** DEADLOCK ***
      [   56.812266]
      [   56.830670] 1 lock held by ksoftirqd/1/13:
      [   56.836838]  #0:  (rcu_read_lock){.+.+..}, at: [<ffffffff8118f44c>] vm_unmap_aliases+0x8c/0x380
      [   56.849757]
      [   56.849757] stack backtrace:
      [   56.862194] CPU: 1 PID: 13 Comm: ksoftirqd/1 Not tainted 3.12.0-rc3+ #45
      [   56.868721] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
      [   56.882004]  ffffffff821944c0 ffff88080bbdb8c8 ffffffff8175a145 0000000000000007
      [   56.895630]  ffff88080bbd5f40 ffff88080bbdb928 ffffffff81755b14 0000000000000001
      [   56.909313]  ffff880800000001 ffff880800000000 ffffffff8101178f 0000000000000001
      [   56.923006] Call Trace:
      [   56.929532]  [<ffffffff8175a145>] dump_stack+0x55/0x76
      [   56.936067]  [<ffffffff81755b14>] print_usage_bug+0x1f7/0x208
      [   56.942445]  [<ffffffff8101178f>] ? save_stack_trace+0x2f/0x50
      [   56.948932]  [<ffffffff810cc0a0>] ? check_usage_backwards+0x150/0x150
      [   56.955470]  [<ffffffff810ccb52>] mark_lock+0x282/0x2c0
      [   56.961945]  [<ffffffff810ccfed>] __lock_acquire+0x45d/0x1d50
      [   56.968474]  [<ffffffff810cce6e>] ? __lock_acquire+0x2de/0x1d50
      [   56.975140]  [<ffffffff81393bf5>] ? cpumask_next_and+0x55/0x90
      [   56.981942]  [<ffffffff810cef72>] lock_acquire+0x92/0x1d0
      [   56.988745]  [<ffffffff8118f52a>] ? vm_unmap_aliases+0x16a/0x380
      [   56.995619]  [<ffffffff817628f1>] _raw_spin_lock+0x41/0x50
      [   57.002493]  [<ffffffff8118f52a>] ? vm_unmap_aliases+0x16a/0x380
      [   57.009447]  [<ffffffff8118f52a>] vm_unmap_aliases+0x16a/0x380
      [   57.016477]  [<ffffffff8118f44c>] ? vm_unmap_aliases+0x8c/0x380
      [   57.023607]  [<ffffffff810436b0>] change_page_attr_set_clr+0xc0/0x460
      [   57.030818]  [<ffffffff810cfb8d>] ? trace_hardirqs_on+0xd/0x10
      [   57.037896]  [<ffffffff811a8330>] ? kmem_cache_free+0xb0/0x2b0
      [   57.044789]  [<ffffffff811b59c3>] ? free_object_rcu+0x93/0xa0
      [   57.051720]  [<ffffffff81043d9f>] set_memory_rw+0x2f/0x40
      [   57.058727]  [<ffffffff8104e17c>] bpf_jit_free+0x2c/0x40
      [   57.065577]  [<ffffffff81642cba>] sk_filter_release_rcu+0x1a/0x30
      [   57.072338]  [<ffffffff811108e2>] rcu_process_callbacks+0x202/0x7c0
      [   57.078962]  [<ffffffff81057f17>] __do_softirq+0xf7/0x3f0
      [   57.085373]  [<ffffffff81058245>] run_ksoftirqd+0x35/0x70
      
      cannot reuse jited filter memory, since it's readonly,
      so use original bpf insns memory to hold work_struct
      
      defer kfree of sk_filter until jit completed freeing
      
      tested on x86_64 and i386
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d45ed4a4
  2. 01 10月, 2013 1 次提交
  3. 30 9月, 2013 3 次提交
    • G
      avr32: cast syscall_return to silence compiler warning · 395e73a2
      Gabor Juhos 提交于
      The patch fixes the following compiler warning:
          CC      arch/avr32/kernel/process.o
        arch/avr32/kernel/process.c: In function 'copy_thread':
        arch/avr32/kernel/process.c:292: warning: assignment makes integer \
        from pointer without a cast
      Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      395e73a2
    • G
      avr32: fix clockevents kernel warning · 1b0135b5
      Gabor Juhos 提交于
      Since commit 01426478
      (avr32: Use generic idle loop) the kernel throws the
      following warning on avr32:
      
        WARNING: at 900322e4 [verbose debug info unavailable]
        Modules linked in:
        CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0-rc2 #117
        task: 901c3ecc ti: 901c0000 task.ti: 901c0000
        PC is at cpu_idle_poll_ctrl+0x1c/0x38
        LR is at comparator_mode+0x3e/0x40
        pc : [<900322e4>]    lr : [<90014882>]    Not tainted
        sp : 901c1f74  r12: 00000000  r11: 901c74a0
        r10: 901d2510  r9 : 00000001  r8 : 901db4de
        r7 : 901c74a0  r6 : 00000001  r5 : 00410020  r4 : 901db574
        r3 : 00410024  r2 : 90206fe0  r1 : 00000000  r0 : 007f0000
        Flags: qvnzc
        Mode bits: hjmde....G
        CPU Mode: Supervisor
        Call trace:
         [<90039ede>] clockevents_set_mode+0x16/0x2e
         [<90039f00>] clockevents_shutdown+0xa/0x1e
         [<9003a078>] clockevents_exchange_device+0x58/0x70
         [<9003a78c>] tick_check_new_device+0x38/0x54
         [<9003a1a2>] clockevents_register_device+0x32/0x90
         [<900035c4>] time_init+0xa8/0x108
         [<90000520>] start_kernel+0x128/0x23c
      
      When the 'avr32_comparator' clockevent device is registered,
      the clockevent core sets the mode of that clockevent device
      to CLOCK_EVT_MODE_SHUTDOWN. Due to this, the 'comparator_mode'
      function calls the 'cpu_idle_poll_ctrl' to disables idle poll.
      This results in the aforementioned warning because the polling
      is not enabled yet.
      
      Change the code to only disable idle poll if it is enabled by
      the same function to avoid the warning.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      1b0135b5
    • S
      avr32: use Kbuild infrastructure to handle the asm-generic headers · 46663d05
      Steven Rostedt 提交于
      Use kbuild to add asm-generic headers that do nothing, also remove the arch
      specific wrapper headers.
      
      This only affects headers that do nothing but include the generic
      equivalent. It does not touch any header that does a little more.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      46663d05
  4. 28 9月, 2013 4 次提交
  5. 27 9月, 2013 6 次提交
    • F
      arm: Fix build error with context tracking calls · 0c06a5d4
      Frederic Weisbecker 提交于
      ad65782f (context_tracking: Optimize main APIs off case
      with static key) converted context tracking main APIs to inline
      function and left ARM asm callers behind.
      
      This can be easily fixed by making ARM calling the post static
      keys context tracking function. We just need to replicate the
      static key checks there. We'll remove these later when ARM will
      support the context tracking static keys.
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Reported-by: NRussell King <linux@arm.linux.org.uk>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Tested-by: NKevin Hilman <khilman@linaro.org>
      Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
      Cc: Anil Kumar <anilk4.v@gmail.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Kevin Hilman <khilman@linaro.org>
      0c06a5d4
    • U
      ARC: Use clockevents_config_and_register over clockevents_register_device · 55c2e262
      Uwe Kleine-König 提交于
      clockevents_config_and_register is more clever and correct than doing it
      by hand; so use it.
      
      [vgupta: fixed build failure due to missing ; in patch]
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      55c2e262
    • V
      ARC: Workaround spinlock livelock in SMP SystemC simulation · 6c00350b
      Vineet Gupta 提交于
      Some ARC SMP systems lack native atomic R-M-W (LLOCK/SCOND) insns and
      can only use atomic EX insn (reg with mem) to build higher level R-M-W
      primitives. This includes a SystemC based SMP simulation model.
      
      So rwlocks need to use a protecting spinlock for atomic cmp-n-exchange
      operation to update reader(s)/writer count.
      
      The spinlock operation itself looks as follows:
      
      	mov reg, 1		; 1=locked, 0=unlocked
      retry:
      	EX reg, [lock]		; load existing, store 1, atomically
      	BREQ reg, 1, rety	; if already locked, retry
      
      In single-threaded simulation, SystemC alternates between the 2 cores
      with "N" insn each based scheduling. Additionally for insn with global
      side effect, such as EX writing to shared mem, a core switch is
      enforced too.
      
      Given that, 2 cores doing a repeated EX on same location, Linux often
      got into a livelock e.g. when both cores were fiddling with tasklist
      lock (gdbserver / hackbench) for read/write respectively as the
      sequence diagram below shows:
      
                 core1                                   core2
               --------                                --------
      1. spin lock [EX r=0, w=1] - LOCKED
      2. rwlock(Read)            - LOCKED
      3. spin unlock  [ST 0]     - UNLOCKED
                                               spin lock [EX r=0,w=1] - LOCKED
                            -- resched core 1----
      
      5. spin lock [EX r=1] - ALREADY-LOCKED
      
                            -- resched core 2----
      6.                                       rwlock(Write) - READER-LOCKED
      7.                                       spin unlock [ST 0]
      8.                                       rwlock failed, retry again
      
      9.                                       spin lock  [EX r=0, w=1]
                            -- resched core 1----
      
      10  spinlock locked in #9, retry #5
      11. spin lock [EX gets 1]
                            -- resched core 2----
      ...
      ...
      
      The fix was to unlock using the EX insn too (step 7), to trigger another
      SystemC scheduling pass which would let core1 proceed, eliding the
      livelock.
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      6c00350b
    • V
      ARC: Fix 32-bit wrap around in access_ok() · 0752adfd
      Vineet Gupta 提交于
      Anton reported
      
       | LTP tests syscalls/process_vm_readv01 and process_vm_writev01 fail
       | similarly in one testcase test_iov_invalid -> lvec->iov_base.
       | Testcase expects errno EFAULT and return code -1,
       | but it gets return code 1 and ERRNO is 0 what means success.
      
      Essentially test case was passing a pointer of -1 which access_ok()
      was not catching. It was doing [@addr + @sz <= TASK_SIZE] which would
      pass for @addr == -1
      
      Fixed that by rewriting as [@addr <= TASK_SIZE - @sz]
      Reported-by: NAnton Kolesov <Anton.Kolesov@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      0752adfd
    • M
      ARC: Handle zero-overhead-loop in unaligned access handler · c11eb222
      Mischa Jonker 提交于
      If a load or store is the last instruction in a zero-overhead-loop, and
      it's misaligned, the loop would execute only once.
      
      This fixes that problem.
      Signed-off-by: NMischa Jonker <mjonker@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      c11eb222
    • S
      x86/microcode/AMD: Fix patch level reporting for family 15h · accd1e82
      Suravee Suthikulpanit 提交于
      On AMD family 14h, applying microcode patch on the a core (core0)
      would also affect the other core (core1) in the same compute
      unit. The driver would skip applying the patch on core1, but it
      still need to update kernel structures to reflect the proper
      patch level.
      
      The current logic is not updating the struct
      ucode_cpu_info.cpu_sig.rev of the skipped core. This causes the
      /sys/devices/system/cpu/cpu1/microcode/version to report
      incorrect patch level as shown below:
      
        $ grep . cpu?/microcode/version
        cpu0/microcode/version:0x600063d
        cpu1/microcode/version:0x6000626
        cpu2/microcode/version:0x600063d
        cpu3/microcode/version:0x6000626
        cpu4/microcode/version:0x600063d
      Signed-off-by: NSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Cc: <bp@alien8.de>
      Cc: <jacob.w.shin@gmail.com>
      Cc: <herrmann.der.user@googlemail.com>
      Link: http://lkml.kernel.org/r/1285806432-1995-1-git-send-email-suravee.suthikulpanit@amd.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      accd1e82
  6. 26 9月, 2013 3 次提交
  7. 25 9月, 2013 11 次提交
  8. 24 9月, 2013 1 次提交
  9. 23 9月, 2013 2 次提交
  10. 22 9月, 2013 3 次提交
  11. 20 9月, 2013 5 次提交