1. 24 1月, 2016 1 次提交
  2. 11 11月, 2015 1 次提交
    • A
      MIPS: Initial implementation of a VDSO · ebb5e78c
      Alex Smith 提交于
      Add an initial implementation of a proper (i.e. an ELF shared library)
      VDSO. With this commit it does not export any symbols, it only replaces
      the current signal return trampoline page. A later commit will add user
      implementations of gettimeofday()/clock_gettime().
      
      To support both new toolchains and old ones which don't generate ABI
      flags section, we define its content manually and then use a tool
      (genvdso) to patch up the section to have the correct name and type.
      genvdso also extracts symbol offsets ({,rt_}sigreturn) needed by the
      kernel, and generates a C file containing a "struct mips_vdso_image"
      containing both the VDSO data and these offsets. This C file is
      compiled into the kernel.
      
      On 64-bit kernels we require a different VDSO for each supported ABI,
      so we may build up to 3 different VDSOs. The VDSO to use is selected by
      the mips_abi structure.
      
      A kernel/user shared data page is created and mapped below the VDSO
      image. This is currently empty, but will be used by the user time
      function implementations which are added later.
      
      [markos.chandras@imgtec.com:
      - Add more comments
      - Move abi detection in genvdso.h since it's the get_symbol function
      that needs it.
      - Add an R6 specific way to calculate the base address of VDSO in order
      to avoid the branch instruction which affects performance.
      - Do not patch .gnu.attributes since it's not needed for dynamic linking.
      - Simplify Makefile a little bit.
      - checkpatch fixes
      - Restrict VDSO support for binutils < 2.25 for pre-R6
      - Include atomic64.h for O32 variant on MIPS64]
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11337/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ebb5e78c
  3. 10 11月, 2015 1 次提交
  4. 06 11月, 2015 1 次提交
    • E
      mm: mlock: add mlock flags to enable VM_LOCKONFAULT usage · b0f205c2
      Eric B Munson 提交于
      The previous patch introduced a flag that specified pages in a VMA should
      be placed on the unevictable LRU, but they should not be made present when
      the area is created.  This patch adds the ability to set this state via
      the new mlock system calls.
      
      We add MLOCK_ONFAULT for mlock2 and MCL_ONFAULT for mlockall.
      MLOCK_ONFAULT will set the VM_LOCKONFAULT modifier for VM_LOCKED.
      MCL_ONFAULT should be used as a modifier to the two other mlockall flags.
      When used with MCL_CURRENT, all current mappings will be marked with
      VM_LOCKED | VM_LOCKONFAULT.  When used with MCL_FUTURE, the mm->def_flags
      will be marked with VM_LOCKED | VM_LOCKONFAULT.  When used with both
      MCL_CURRENT and MCL_FUTURE, all current mappings and mm->def_flags will be
      marked with VM_LOCKED | VM_LOCKONFAULT.
      
      Prior to this patch, mlockall() will unconditionally clear the
      mm->def_flags any time it is called without MCL_FUTURE.  This behavior is
      maintained after adding MCL_ONFAULT.  If a call to mlockall(MCL_FUTURE) is
      followed by mlockall(MCL_CURRENT), the mm->def_flags will be cleared and
      new VMAs will be unlocked.  This remains true with or without MCL_ONFAULT
      in either mlockall() invocation.
      
      munlock() will unconditionally clear both vma flags.  munlockall()
      unconditionally clears for VMA flags on all VMAs and in the mm->def_flags
      field.
      Signed-off-by: NEric B Munson <emunson@akamai.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b0f205c2
  5. 05 10月, 2015 2 次提交
  6. 30 9月, 2015 1 次提交
  7. 03 9月, 2015 7 次提交
    • Y
      MIPS: UAPI: Fix unrecognized opcode WSBH/DSBH/DSHD when using MIPS16. · e0d8b2ec
      Yousong Zhou 提交于
      The nomips16 has to be added both as function attribute and assembler
      directive.
      
      When only function attribute is specified, the compiler will inline the
      function with -Os optimization.  The generated assembly code cannot be
      correctly assembled because ISA mode switch has to be done through jump
      instruction.
      
      When only ".set nomips16" directive is used, the generated assembly code
      will use MIPS32 code for the inline assembly template and MIPS16 for the
      function return.  The compiled binary is invalid:
      
          00403100 <__arch_swab16>:
            403100:   7c0410a0    wsbh    v0,a0
            403104:   e820ea31    swc2    $0,-5583(at)
      
      while correct code should be:
      
          00402650 <__arch_swab16>:
            402650:   7c0410a0    wsbh    v0,a0
            402654:   03e00008    jr  ra
            402658:   3042ffff    andi    v0,v0,0xffff
      Signed-off-by: NYousong Zhou <yszhou4tech@gmail.com>
      Cc: Chen Jie <chenj@lemote.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11087/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e0d8b2ec
    • M
      MIPS: inst.h: Add new MIPS R6 FPU opcodes · 107d3400
      Markos Chandras 提交于
      Add opcodes for the new MIPS R6 FPU instructions.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/10952/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      107d3400
    • R
      MIPS: Add uprobes support. · 40e084a5
      Ralf Baechle 提交于
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      40e084a5
    • P
      MIPS: AT_HWCAP aux vector infrastructure · e14f1db7
      Paul Burton 提交于
      In order for userland to determine whether various features are safe to
      use, it will need to know both that the hardware supports those features
      and that the kernel is recent enough & configured appropriately to
      support them. For example under the O32 modeless FP proposal the dynamic
      linker & ifunc resolvers will need this information.  The kernel is the
      only thing in a position to know availability accurately, so the kernel
      needs to provide the information to userland. This patch introduces the
      infrastructure to provide the AT_HWCAP aux vector to userland in order
      to provide that information. It also defines the 2 currently specified
      flags, which indicate MIPSr6 & MSA support.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: Alex Smith <alex@alex-smith.me.uk>
      Cc: linux-kernel@vger.kernel.org
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Patchwork: https://patchwork.linux-mips.org/patch/10797/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e14f1db7
    • P
      MIPS: Add definitions for extended context · f1fe2d21
      Paul Burton 提交于
      The context introduced by MSA needs to be saved around signals. However,
      we can't increase the size of struct sigcontext because that will change
      the offset of the signal mask in struct sigframe or struct ucontext.
      This patch instead places the new context immediately after the struct
      sigframe for traditional signals, or similarly after struct ucontext for
      RT signals. The layout of struct sigframe & struct ucontext is identical
      from their sigcontext fields onwards, so the offset from the sigcontext
      to the extended context will always be the same regardless of the type
      of signal.
      
      Userland will be able to search through the extended context by using
      the magic values to detect which types of context are present. Any
      unrecognised context can be skipped over using the size field of struct
      extcontext. Once the magic value END_EXTCONTEXT_MAGIC is seen it is
      known that there are no further extended context structures to examine.
      
      This approach is somewhat similar to that taken by ARM to save VFP &
      other context at the end of struct ucontext.
      
      Userland can determine whether extended context is present by checking
      for the USED_EXTCONTEXT bit in the sc_used_math field of struct
      sigcontext. Whilst this could potentially change the historic semantics
      of sc_used_math if further extended context which does not imply FP
      context were to be introduced in the future, I have been unable to find
      any userland code making use of sc_used_math at all. Using one of the
      fields described as unused in struct sigcontext was considered, but the
      kernel does not already write to those fields so there would be no
      guarantee of the field being clear on older kernels. Other alternatives
      would be to have userland check the kernel version, or to have a HWCAP
      bit indicating presence of extended context. However there is a desire
      to have the context & information required to decode it be self
      contained such that, for example, debuggers could decode the saved
      context easily.
      
      [ralf@linux-mips.org: Fixed conflict.]
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
      Cc: Alex Smith <alex@alex-smith.me.uk>
      Cc: linux-kernel@vger.kernel.org
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Daniel Borkmann <dborkman@redhat.com>
      Cc: Maciej W. Rozycki <macro@codesourcery.com>
      Patchwork: https://patchwork.linux-mips.org/patch/10795/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f1fe2d21
    • P
      MIPS: Indicate FP mode in sigcontext sc_used_math · 0d071fa3
      Paul Burton 提交于
      The sc_used_math field of struct sigcontext & its variants has
      traditionally been used as a boolean value indicating only whether or
      not floating point context is saved within the sigcontext. With various
      supported FP modes & the ability to switch between them this information
      will no longer be enough to decode the meaning of the data stored in the
      sc_fpregs fields of struct sigcontext.
      
      To make that possible 3 bits are defined within sc_used_math:
      
        - Bit 0 (USED_FP) represents whether FP was used, essentially
          providing the boolean flag which sc_used_math as a whole provided
          previously.
      
        - Bit 1 (USED_FR1) provides the value of the Status.FR bit at the time
          the FP context was saved.
      
        - Bit 2 (USED_HYBRID_FPRS) indicates whether the FP context was saved
          under the hybrid FPR scheme. Essentially, when set the odd singles
          are located in bits 63:32 of the preceding even indexed sc_fpregs
          element.
      
      Any userland that tests whether the sc_used_math field is zero or
      non-zero will continue to function as expected. Having said that, I
      could not find any userland which uses the sc_used_math field at all.
      
      [ralf@linux-mips.org: Fixed rejects.]
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: linux-kernel@vger.kernel.org
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Maciej W. Rozycki <macro@codesourcery.com>
      Patchwork: https://patchwork.linux-mips.org/patch/10794/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0d071fa3
    • L
      MIPS: Declare MSA MI10 instruction formats · 6701ca2d
      Leonid Yegoshin 提交于
      Declare a struct describing the MSA MI10 instruction format used for ld &
      st instructions, for use by subsequent patches.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/10571/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6701ca2d
  8. 14 7月, 2015 1 次提交
  9. 28 3月, 2015 3 次提交
    • J
      MIPS: KVM: Expose MSA registers · ab86bd60
      James Hogan 提交于
      Add KVM register numbers for the MIPS SIMD Architecture (MSA) registers,
      and implement access to them with the KVM_GET_ONE_REG / KVM_SET_ONE_REG
      ioctls when the MSA capability is enabled (exposed in a later patch) and
      present in the guest according to its Config3.MSAP bit.
      
      The MSA vector registers use the same register numbers as the FPU
      registers except with a different size (128bits). Since MSA depends on
      Status.FR=1, these registers are inaccessible when Status.FR=0. These
      registers are returned as a single native endian 128bit value, rather
      than least significant half first with each 64-bit half native endian as
      the kernel uses internally.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Cc: linux-api@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      ab86bd60
    • J
      MIPS: KVM: Expose FPU registers · 379245cd
      James Hogan 提交于
      Add KVM register numbers for the MIPS FPU registers, and implement
      access to them with the KVM_GET_ONE_REG / KVM_SET_ONE_REG ioctls when
      the FPU capability is enabled (exposed in a later patch) and present in
      the guest according to its Config1.FP bit.
      
      The registers are accessible in the current mode of the guest, with each
      sized access showing what the guest would see with an equivalent access,
      and like the architecture they may become UNPREDICTABLE if the FR mode
      is changed. When FR=0, odd doubles are inaccessible as they do not exist
      in that mode.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Cc: linux-api@vger.kernel.org
      Cc: linux-doc@vger.kernel.org
      379245cd
    • J
      MIPS: KVM: Clean up register definitions a little · 7bd4acec
      James Hogan 提交于
      Clean up KVM_GET_ONE_REG / KVM_SET_ONE_REG register definitions for
      MIPS, to prepare for adding a new group for FPU & MSA vector registers.
      
      Definitions are added for common bits in each group of registers, e.g.
      KVM_REG_MIPS_CP0 = KVM_REG_MIPS | 0x10000, for the coprocessor 0
      registers.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      7bd4acec
  10. 19 2月, 2015 1 次提交
  11. 17 2月, 2015 7 次提交
  12. 16 2月, 2015 1 次提交
  13. 13 1月, 2015 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. 25 11月, 2014 1 次提交
  16. 24 11月, 2014 1 次提交
  17. 18 11月, 2014 1 次提交
  18. 12 11月, 2014 1 次提交
    • E
      net: introduce SO_INCOMING_CPU · 2c8c56e1
      Eric Dumazet 提交于
      Alternative to RPS/RFS is to use hardware support for multiple
      queues.
      
      Then split a set of million of sockets into worker threads, each
      one using epoll() to manage events on its own socket pool.
      
      Ideally, we want one thread per RX/TX queue/cpu, but we have no way to
      know after accept() or connect() on which queue/cpu a socket is managed.
      
      We normally use one cpu per RX queue (IRQ smp_affinity being properly
      set), so remembering on socket structure which cpu delivered last packet
      is enough to solve the problem.
      
      After accept(), connect(), or even file descriptor passing around
      processes, applications can use :
      
       int cpu;
       socklen_t len = sizeof(cpu);
      
       getsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, &len);
      
      And use this information to put the socket into the right silo
      for optimal performance, as all networking stack should run
      on the appropriate cpu, without need to send IPI (RPS/RFS).
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c8c56e1
  19. 27 10月, 2014 1 次提交
  20. 23 10月, 2014 1 次提交
    • A
      MIPS: ptrace.h: Add a missing include · cdb685ad
      Aaro Koskinen 提交于
      Commit a79ebea6 (MIPS: ptrace: Fix user pt_regs definition,
      use in ptrace_{get, set}regs()) converted struct pt_regs to use __u64.
      Some userspace applications (e.g. GDB) include this file directly,
      and fail to see this type. Fix by including <linux/types.h>.
      
      The patch fixes the following build failure with GDB 7.8 when using
      GLIBC headers created against Linux 3.17:
      
      In file included from /home/aaro/los/work/shared/gdb-7.8/gdb/mips-linux-nat.c:37:0:
      /home/aaro/los/work/mips/rootfs/mips-linux-gnu/usr/include/asm/ptrace.h:32:2: error: unknown type name '__u64'
        __u64 regs[32];
        ^
      /home/aaro/los/work/mips/rootfs/mips-linux-gnu/usr/include/asm/ptrace.h:35:2: error: unknown type name '__u64'
        __u64 lo;
        ^
      /home/aaro/los/work/mips/rootfs/mips-linux-gnu/usr/include/asm/ptrace.h:36:2: error: unknown type name '__u64'
        __u64 hi;
        ^
      
      Fixes: a79ebea6 ("MIPS: ptrace: Fix user pt_regs definition, use in ptrace_{get, set}regs()")
      Cc: stable@vger.kernel.org # 3.17
      Signed-off-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Alex Smith <alex@alex-smith.me.uk>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8067/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cdb685ad
  21. 22 9月, 2014 1 次提交
  22. 11 9月, 2014 1 次提交
  23. 26 8月, 2014 1 次提交
  24. 02 8月, 2014 2 次提交