1. 19 2月, 2015 1 次提交
    • R
      MIPS: Makefile: Pass -march option on Loongson3A cores · a8140f36
      Ralf Baechle 提交于
      The loongson 3A cores do not select a suitable -march option so the build
      system uses the default one from the toolchain. This may or may not be
      suitable for a loongson 3A build. In order to avoid that, we explicitly set
      a suitable -march option for that core.  Furthermore, some very old
      compilers don't support -march= at all and there is the possibility of
      toolchain combinations such as GCC 4.9 and binutils 2.24 for which
      -march=loongson3a will result in MIPS64 R2 code being generated but then
      rejected by GAS.  So treat the Longsoon 3A as an R2 CPU.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a8140f36
  2. 16 2月, 2015 4 次提交
  3. 12 2月, 2015 1 次提交
    • P
      MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS · 9791554b
      Paul Burton 提交于
      Userland code may be built using an ABI which permits linking to objects
      that have more restrictive floating point requirements. For example,
      userland code may be built to target the O32 FPXX ABI. Such code may be
      linked with other FPXX code, or code built for either one of the more
      restrictive FP32 or FP64. When linking with more restrictive code, the
      overall requirement of the process becomes that of the more restrictive
      code. The kernel has no way to know in advance which mode the process
      will need to be executed in, and indeed it may need to change during
      execution. The dynamic loader is the only code which will know the
      overall required mode, and so it needs to have a means to instruct the
      kernel to switch the FP mode of the process.
      
      This patch introduces 2 new options to the prctl syscall which provide
      such a capability. The FP mode of the process is represented as a
      simple bitmask combining a number of mode bits mirroring those present
      in the hardware. Userland can either retrieve the current FP mode of
      the process:
      
        mode = prctl(PR_GET_FP_MODE);
      
      or modify the current FP mode of the process:
      
        err = prctl(PR_SET_FP_MODE, new_mode);
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8899/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9791554b
  4. 05 2月, 2015 1 次提交
    • J
      MIPS: cevt-r4k: Drop GIC special case · ae58d882
      James Hogan 提交于
      The cevt-r4k driver used to call into the GIC driver to find whether the
      timer was pending, but only with External Interrupt Controller (EIC)
      mode, where the Cause.IP bits can't be used as they encode the interrupt
      priority level (Cause.RIPL) instead.
      
      However commit e9de688d ("irqchip: mips-gic: Support local
      interrupts") changed the condition from cpu_has_veic to gic_present.
      This fails on cores such as P5600 which have a GIC but the local
      interrupts aren't routable by the GIC, causing c0_compare_int_usable()
      to consider the interrupt unusable so r4k_clockevent_init() fails.
      
      The previous behaviour, added in commit 98b67c37 ("MIPS: Add EIC
      support for GIC."), wasn't really correct either as far as I can tell,
      since P5600 apparently supports EIC mode too, and in any case the use of
      Cause.TI with r2 should have been sufficient anyway since commit
      010c108d ("MIPS: PowerTV: Fix support for timer interrupts with > 64
      external IRQs").
      
      Therefore drop the call into the gic driver altogether, and add a
      comment in c0_compare_int_pending() to clarify that Cause.TI does get
      checked since MIPS r2.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Fixes: e9de688d ("irqchip: mips-gic: Support local interrupts")
      Reviewed-by: NAndrew Bresticker <abrestic@chromium.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Steven J. Hill <steven.hill@imgtec.com>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9077/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ae58d882
  5. 04 2月, 2015 1 次提交
  6. 16 1月, 2015 2 次提交
  7. 13 1月, 2015 8 次提交
  8. 20 12月, 2014 1 次提交
  9. 18 12月, 2014 1 次提交
  10. 13 12月, 2014 1 次提交
  11. 12 12月, 2014 2 次提交
    • A
      arch: Add lightweight memory barriers dma_rmb() and dma_wmb() · 1077fa36
      Alexander Duyck 提交于
      There are a number of situations where the mandatory barriers rmb() and
      wmb() are used to order memory/memory operations in the device drivers
      and those barriers are much heavier than they actually need to be.  For
      example in the case of PowerPC wmb() calls the heavy-weight sync
      instruction when for coherent memory operations all that is really needed
      is an lsync or eieio instruction.
      
      This commit adds a coherent only version of the mandatory memory barriers
      rmb() and wmb().  In most cases this should result in the barrier being the
      same as the SMP barriers for the SMP case, however in some cases we use a
      barrier that is somewhere in between rmb() and smp_rmb().  For example on
      ARM the rmb barriers break down as follows:
      
        Barrier   Call     Explanation
        --------- -------- ----------------------------------
        rmb()     dsb()    Data synchronization barrier - system
        dma_rmb() dmb(osh) data memory barrier - outer sharable
        smp_rmb() dmb(ish) data memory barrier - inner sharable
      
      These new barriers are not as safe as the standard rmb() and wmb().
      Specifically they do not guarantee ordering between coherent and incoherent
      memories.  The primary use case for these would be to enforce ordering of
      reads and writes when accessing coherent memory that is shared between the
      CPU and a device.
      
      It may also be noted that there is no dma_mb().  Most architectures don't
      provide a good mechanism for performing a coherent only full barrier without
      resorting to the same mechanism used in mb().  As such there isn't much to
      be gained in trying to define such a function.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: David Miller <davem@davemloft.net>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1077fa36
    • A
      arch: Cleanup read_barrier_depends() and comments · 8a449718
      Alexander Duyck 提交于
      This patch is meant to cleanup the handling of read_barrier_depends and
      smp_read_barrier_depends.  In multiple spots in the kernel headers
      read_barrier_depends is defined as "do {} while (0)", however we then go
      into the SMP vs non-SMP sections and have the SMP version reference
      read_barrier_depends, and the non-SMP define it as yet another empty
      do/while.
      
      With this commit I went through and cleaned out the duplicate definitions
      and reduced the number of definitions down to 2 per header.  In addition I
      moved the 50 line comments for the macro from the x86 and mips headers that
      defined it as an empty do/while to those that were actually defining the
      macro, alpha and blackfin.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a449718
  12. 11 12月, 2014 1 次提交
  13. 09 12月, 2014 1 次提交
  14. 06 12月, 2014 1 次提交
    • A
      net: sock: allow eBPF programs to be attached to sockets · 89aa0758
      Alexei Starovoitov 提交于
      introduce new setsockopt() command:
      
      setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd, sizeof(prog_fd))
      
      where prog_fd was received from syscall bpf(BPF_PROG_LOAD, attr, ...)
      and attr->prog_type == BPF_PROG_TYPE_SOCKET_FILTER
      
      setsockopt() calls bpf_prog_get() which increments refcnt of the program,
      so it doesn't get unloaded while socket is using the program.
      
      The same eBPF program can be attached to multiple sockets.
      
      User task exit automatically closes socket which calls sk_filter_uncharge()
      which decrements refcnt of eBPF program
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89aa0758
  15. 04 12月, 2014 1 次提交
  16. 28 11月, 2014 1 次提交
  17. 26 11月, 2014 1 次提交
  18. 25 11月, 2014 6 次提交
  19. 24 11月, 2014 5 次提交
    • M
      MIPS: lib: memset: Clean up some MIPS{EL,EB} ifdefery · dd2adea4
      Markos Chandras 提交于
      The toolchain defines exactly one of __MIPSEB__ and
      __MIPSEL__. As a result, simplify the ifdefery a little bit.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8522/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      dd2adea4
    • M
      MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO · 0845bb72
      Markos Chandras 提交于
      Using the __raw_{read,write}{b,w,l} functions to perform
      repeatable MMIO could result in problems if the host bus
      does not match the endianness of the PCI/ISA. This problem
      is visible on big-endian SEAD3 configurations after commit
      2925f6c0
      "net: smc911x: use io{read,write}*_rep accessors". This effectively
      moves away from using the __mem_* variants to __raw_* ones
      and causes a kernel bug as follows:
      
      Call Trace:
      CPU 0 Unable to handle kernel paging request at virtual address 00000000,
      epc == 00000000, ra == 8012b3b0
      Oops[#1]:
      Cpu 0
      $ 0   : 00000000 00000065 00000000 00000004
      $ 4   : 00000000 00000000 9a82dd60 00000000
      $ 8   : 00000000 00000000 a00ae278 00000007
      $12   : 0000000e 00000011 804c4228 ffff9411
      $16   : 00000100 00000000 80560000 807fc6d0
      $20   : 807fc8d0 807fcad0 807fbec0 00000100
      $24   : 00009150 80109be0
      $28   : 9a82c000 9a82dd28 00000001 8012b3b0
      Hi    : 00000000
      Lo    : 00000000
      epc   : 00000000   (null)
          Not tainted
      ra    : 8012b3b0 call_timer_fn.isra.39+0x24/0x84
      Status: 10009503    KERNEL EXL IE
      Cause : 00800808
      BadVA : 00000000
      PrId  : 00019c20 (MIPS M14Kc)
      Modules linked in:
      Process swapper (pid: 1, threadinfo=9a82c000, task=9a82ba18, tls=00000000)
      Stack : 00000040 00000000 00000007 8056732c 80580000 00000001 9a82dd60 00200200
              80560000 8012b598 8056732c 80580000 00000001 00000000 9a82dd60 9a82dd60
              00000000 807fbd44 807fbd40 805664e0 0000000a 80800000 00000004 80125924
              0000fda0 000007f0 80000000 00000001 80800000 007f0000 00200140 80166338
              00000000 8100fda0 0000fda0 000007f0 80000000 00000001 80800000 007f0000
              ...
      Call Trace:
      [<8012b598>] run_timer_softirq+0x188/0x1f4
      [<80125924>] __do_softirq+0xc4/0x18c
      [<80166338>] handle_percpu_irq+0x54/0x84
      [<80125aa4>] do_softirq+0x68/0x70
      [<80103b50>] do_IRQ+0x18/0x28
      [<80125d1c>] irq_exit+0x94/0xc0
      [<80125aa4>] do_softirq+0x68/0x70
      [<80102130>] ret_from_irq+0x0/0x4
      [<80102130>] ret_from_irq+0x0/0x4
      [<80125d1c>] irq_exit+0x94/0xc0
      [<803165b0>] __bzero+0xd4/0x164
      [<80346d0c>] mem32_serial_out+0x0/0x1c
      [<8010d4ac>] free_init_pages+0x98/0xfc
      [<80180a08>] free_hot_cold_page+0x2c/0x1c4
      [<80180bd8>] __free_pages+0x38/0x98
      [<8010d4a0>] free_init_pages+0x8c/0xfc
      [<8010d4ac>] free_init_pages+0x98/0xfc
      [<8049fb04>] kernel_init+0x28/0x15c
      [<80147484>] schedule_tail+0x1c/0x60
      [<8049fadc>] kernel_init+0x0/0x15c
      [<80102178>] ret_from_kernel_thread+0x14/0x1c
      [<8040a06f>] skb_pad+0xe7/0x13c
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: Steve Glendinning <steve.glendinning@shawell.net>
      Cc: Ben Boeckel <mathstuf@gmail.com>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Cc: Jeffrey Deans <Jeffrey.Deans@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6672/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0845bb72
    • R
      MIPS: <asm/types.h> fix indentation. · d98aefc3
      Ralf Baechle 提交于
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d98aefc3
    • P
      MIPS: Enable VDSO randomization · ccd39880
      Prem Karat 提交于
      Based on commit 1091458d (mmap randomization)
      
      For 32-bit address spaces randomize within a
      16MB space, for 64-bit within a 256MB space.
      
      Test Results:
      ------------
      Without Patch (VDSO is not randomized)
      ---------------------------------------
      root@Maleo:~# ./aslr vdso
      FAIL: ASLR not functional (vdso always at 0x7fff7000)
      
      root@Maleo:~# ./aslr rekey vdso
      pre_val==cur_val
      value=0x7fff7000
      
      With patch:(VDSO is randmoized and doesn't interfere with stack)
      ----------------------------------------------------------------
      root@cavium-octeon2:~# ./aslr rekey vdso
      pre_val!=cur_val
      previous_value=0x7f830ea2
      current_value=0x776e2000
      root@cavium-octeon2:~# ./aslr rekey vdso
      pre_val!=cur_val
      previous_value=0x7fb0cea2
      current_value=0x77209000
      root@cavium-octeon2:~# ./aslr rekey vdso
      pre_val!=cur_val
      previous_value=0x7f985ea2
      current_value=0x7770c000
      root@cavium-octeon2:~# ./aslr rekey vdso
      pre_val!=cur_val
      previous_value=0x7fbc6ea2
      current_value=0x7fe25000
      
      Maps file output:
      -------------------------
      root@cavium-octeon2:~# ./aslr rekey maps
      78584000-785a5000 rwxp 00000000 00:00 0                                  [heap]
      7f9d0000-7f9f1000 rw-p 00000000 00:00 0                                  [stack]
      7ffa5000-7ffa6000 r-xp 00000000 00:00 0                                  [vdso]
      
      root@cavium-octeon2:~# ./aslr rekey maps
      77de0000-77e01000 rwxp 00000000 00:00 0                                  [heap]
      7f91b000-7f93c000 rw-p 00000000 00:00 0                                  [stack]
      7ff99000-7ff9a000 r-xp 00000000 00:00 0                                  [vdso]
      
      root@cavium-octeon2:~# ./aslr rekey maps
      77d7f000-77da0000 rwxp 00000000 00:00 0                                  [heap]
      7fc2a000-7fc4b000 rw-p 00000000 00:00 0                                  [stack]
      7fe09000-7fe0a000 r-xp 00000000 00:00 0                                  [vdso]
      
      root@cavium-octeon2:~# ./aslr rekey maps
      7794c000-7794d000 r-xp 00000000 00:00 0                                  [vdso]
      77e4b000-77e6c000 rwxp 00000000 00:00 0                                  [heap]
      7f6e7000-7f708000 rw-p 00000000 00:00 0                                  [stack]
      root@cavium-octeon2:~#
      Signed-off-by: NPrem Karat <pkarat@mvista.com>
      Cc: linux-mips@linux-mips.org
      Cc: sergei.shtylyov@cogentembedded.com
      Cc: ddaney.cavm@gmail.com
      Patchwork: https://patchwork.linux-mips.org/patch/6812Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ccd39880
    • R
      MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration · ac41f9c4
      Ralf Baechle 提交于
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: aaro.koskinen@iki.fi
      Cc: david.daney@cavium.com
      Cc: linux-kernel@vger.kernel.org
      Cc: markos.chandras@imgtec.com
      Cc: dengcheng.zhu@imgtec.com
      Cc: chenhc@lemote.com
      Cc: akpm@linux-foundation.org
      Patchwork: https://patchwork.linux-mips.org/patch/8535/
      ac41f9c4