1. 01 2月, 2013 4 次提交
  2. 31 1月, 2013 1 次提交
    • A
      MIPS: Function tracer: Fix broken function tracing · 58b69401
      Al Cooper 提交于
      Function tracing is currently broken for all 32 bit MIPS platforms.
      When tracing is enabled, the kernel immediately hangs on boot.
      This is a result of commit b732d439
      that changes the kernel/trace/Kconfig file so that is no longer
      forces FRAME_POINTER when FUNCTION_TRACING is enabled.
      
      MIPS frame pointers are generally considered to be useless because
      they cannot be used to unwind the stack. Unfortunately the MIPS
      function tracing code has bugs that are masked by the use of frame
      pointers. This commit fixes the bugs so that MIPS frame pointers
      don't need to be enabled.
      
      The bugs are a result of the odd calling sequence used to call the trace
      routine. This calling sequence is inserted into every traceable function
      when the tracing CONFIG option is enabled. This sequence is generated
      for 32bit MIPS platforms by the compiler via the "-pg" flag.
      
      Part of the sequence is "addiu sp,sp,-8" in the delay slot after every
      call to the trace routine "_mcount" (some legacy thing where 2 arguments
      used to be pushed on the stack). The _mcount routine is expected to
      adjust the sp by +8 before returning.  So when not disabled, the original
      jalr and addiu will be there, so _mcount has to adjust sp.
      
      The problem is that when tracing is disabled for a function, the
      "jalr _mcount" instruction is replaced with a nop, but the
      "addiu sp,sp,-8" is still executed and the stack pointer is left
      trashed. When frame pointers are enabled the problem is masked
      because any access to the stack is done through the frame
      pointer and the stack pointer is restored from the frame pointer when
      the function returns.
      
      This patch writes two nops starting at the address of the "jalr _mcount"
      instruction whenever tracing is disabled. This means that the
      "addiu sp,sp.-8" will be converted to a nop along with the "jalr".  When
      disabled, there will be two nops.
      
      This is SMP safe because the first time this happens is during
      ftrace_init() which is before any other processor has been started.
      Subsequent calls to enable/disable tracing when other CPUs ARE running
      will still be safe because the enable will only change the first nop
      to a "jalr" and the disable, while writing 2 nops, will only be changing
      the "jalr". This patch also stops using stop_machine() to call the
      tracer enable/disable routines and calls them directly because the
      routines are SMP safe.
      
      When the kernel first boots we have to be able to handle the gcc
      generated jalr, addui sequence until ftrace_init gets a chance to run
      and change the sequence. At this point mcount just adjusts the stack
      and returns. When ftrace_init runs, we convert the jalr/addui to nops.
      Then whenever tracing is enabled we convert the first nop to a "jalr
      mcount+8". The mcount+8 entry point skips the stack adjust.
      
      [ralf@linux-mips.org: Folded in  Steven Rostedt's build fix.]
      Signed-off-by: NAl Cooper <alcooperx@gmail.com>
      Cc: rostedt@goodmis.org
      Cc: ddaney.cavm@gmail.com
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/4806/
      Patchwork: https://patchwork.linux-mips.org/patch/4841/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      58b69401
  3. 16 1月, 2013 1 次提交
  4. 04 1月, 2013 1 次提交
    • G
      MIPS: drivers: remove __dev* attributes. · 28eb0e46
      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, __devexit_p, __devinitdata,
      and __devexit from these drivers.
      
      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>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      28eb0e46
  5. 29 12月, 2012 4 次提交
  6. 27 12月, 2012 1 次提交
  7. 14 12月, 2012 7 次提交
    • R
      MIPS: PMC-Sierra Yosemite: Remove support. · bdf20507
      Ralf Baechle 提交于
      Nobody seems to be interested anymore and upstream also never had an
      ethernet driver.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      bdf20507
    • M
      MIPS: Handle COP3 Unusable exception as COP1X for FP emulation · 051ff44a
      Maciej W. Rozycki 提交于
       Our FP emulator is hardcoded for the MIPS IV FP instruction set and does
      not match the FP ISA with the general ISA.  However for the few MIPS IV FP
      instructions that use the COP1X major opcode it relies on the Coprocessor
      Unusable exception to be delivered as a COP1 rather than COP3 exception.
      This includes indexed transfer (LDXC1, etc.) and FP multiply-accumulate
      (MADD.D, etc.) instructions.
      
       All the MIPS I, II, III and IV processors and some newer chips that do not
      implement the FPU use the COP3 exception however.  Therefore I believe the
      kernel should follow and redirect any COP3 Unusable traps to the emulator
      unless an actual FPU part or core is present.
      
       This is a change that implements it.  Any minor opcode encodings that are
      not recognised as valid FP instructions are rejected by the emulator and
      will result in a SIGILL signal being delivered as they currently do.  We
      do not support vendor-specific coprocessor 3 implementations supported
      with MIPS I and MIPS II ISA processors; we never set CP0.Status.CU3.
      
      [Ralf: On MIPS IV processors the kernel always enables the XX bit which
      replaces the CU3 bit off earlier architecture revisions.]
      
       If matching between the CPU and the FPU ISA is considered required one
      day, this can still be done in the emulator itself.  I think the CpU
      exception dispatcher is not the right place to do this anyway, as there
      are further differences between MIPS I, MIPS II, MIPS III, MIPS IV and
      MIPS32 FP ISAs.
      
       Corresponding explanation of this implementation is included within the
      change itself.
      Signed-off-by: NMaciej W. Rozycki <macro@codesourcery.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/project/linux-mips/list/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      051ff44a
    • H
      MIPS: Fix poweroff failure when HOTPLUG_CPU configured. · 8add1ecb
      Huacai Chen 提交于
      When poweroff machine, kernel_power_off() call disable_nonboot_cpus().
      And if we have HOTPLUG_CPU configured, disable_nonboot_cpus() is not an
      empty function but attempt to actually disable the nonboot cpus. Since
      system state is SYSTEM_POWER_OFF, play_dead() won't be called and thus
      disable_nonboot_cpus() hangs. Therefore, we make this patch to avoid
      poweroff failure.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NHongliang Tao <taohl@lemote.com>
      Signed-off-by: NHua Yan <yanh@lemote.com>
      Cc: Yong Zhang <yong.zhang@windriver.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/4211/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8add1ecb
    • F
      MIPS: MT: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS=y · b88fb18e
      Florian Fainelli 提交于
      When CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled, plain integer checking
      between different uids/gids is explicitely turned into a build failure
      by making the k{uid,gid}_t types a structure containing a value:
      
      arch/mips/kernel/mips-mt-fpaff.c: In function 'check_same_owner':
      arch/mips/kernel/mips-mt-fpaff.c:53:22: error: invalid operands to
      binary == (have 'kuid_t' and 'kuid_t')
      arch/mips/kernel/mips-mt-fpaff.c:54:15: error: invalid operands to
      binary == (have 'kuid_t' and 'kuid_t')
      
      In order to ensure proper comparison between uids, using the helper
      function uid_eq() which performs the right thing whenever this config
      option is turned on or off.
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Patchwork: https://patchwork.linux-mips.org/patch/4717/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b88fb18e
    • R
      MIPS: Remove usage of CEVT_R4K_LIB config option. · f772cdb2
      Ralf Baechle 提交于
      Manuel Lauss <manuel.lauss@gmail.com> writes:
      
      I introduced it as a fallback because early revisions of Alchemy hardware
      we shipped had a non-functional 32kHz timer and had to rely on the r4k
      timer instead.  Previously the r4k timer was initialized regardless, but
      it's useless with the "wait" instruction.
      
      So long story short:   I need either the on-chip 32kHz timer OR the r4k
      timer if the 32kHz one is unusable, but not both, and r4k timer is useless
      when au1k_idle is in use.
      
      The current in-kernel Alchemy boards all work with the 32kHz timer, so I'm
      not against removing R4K_LIB symbols.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f772cdb2
    • S
      MIPS: Remove usage of CSRC_R4K_LIB config option. · d7ea335c
      Steven J. Hill 提交于
      Manuel Lauss <manuel.lauss@gmail.com> writes:
      
      I introduced it as a fallback because early revisions of Alchemy hardware
      we shipped had a non-functional 32kHz timer and had to rely on the r4k
      timer instead.  Previously the r4k timer was initialized regardless, but
      it's useless with the "wait" instruction.
      
      So long story short:   I need either the on-chip 32kHz timer OR the r4k
      timer if the 32kHz one is unusable, but not both, and r4k timer is useless
      when au1k_idle is in use.
      
      The current in-kernel Alchemy boards all work with the 32kHz timer, so I'm
      not against removing R4K_LIB symbols.
      Signed-off-by: NSteven J. Hill <sjhill@mips.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d7ea335c
    • R
      MIPS: Octeon: Add kexec and kdump support · abe77f90
      Ralf Baechle 提交于
      [ralf@linux-mips.org: Original patch by Maxim Uvarov <muvarov@gmail.com>
      with plenty of further shining, polishing, debugging and testing by me.]
      Signed-off-by: NMaxim Uvarov <muvarov@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: kexec@lists.infradead.org
      Cc: horms@verge.net.au
      Patchwork: https://patchwork.linux-mips.org/patch/1026/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      abe77f90
  8. 13 12月, 2012 1 次提交
  9. 12 12月, 2012 3 次提交
  10. 06 12月, 2012 3 次提交
  11. 05 12月, 2012 1 次提交
    • R
      MIPS: N32: Fix preadv(2) and pwritev(2) entry points. · d5563715
      Ralf Baechle 提交于
      By using the native syscall entry point the kernel was also expecting
      64-bit iovec structures.
      
      This is broken since ddd9e91b [preadv/
      pwritev: MIPS: Add preadv(2) and pwritev(2) syscalls.] which originally
      added these two syscalls.  I walked through piles of code, including
      libc and couldn't find anything that would have worked around the issue
      so this change the API to what it should always have been.
      
      Noticed and patch suggested by Al Viro.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d5563715
  12. 29 11月, 2012 2 次提交
  13. 26 11月, 2012 1 次提交
  14. 24 11月, 2012 1 次提交
    • R
      MIPS: Merge overlapping bootmem ranges · 0ec7ec75
      Ralf Baechle 提交于
      Without this, we may end up with something like this in /proc/iomem:
      
      01100000-014fffff : System RAM
        01100000-013bf48f : Kernel code
        013bf490-0149e01f : Kernel data
      01500000-0c0fffff : System RAM
      
      but the two System RAM ranges should be one single range.  This particular
      case will result in kexec failure on Octeon systems if the kernel being
      loaded by kexec is bigger than the already running kernel.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0ec7ec75
  15. 19 11月, 2012 1 次提交
    • E
      userns: On mips modify check_same_owner to use uid_eq · dd34ad35
      Eric W. Biederman 提交于
      The kbuild test robot <fengguang.wu@intel.com> report the following error
      when building mips with user namespace support enabled.
      
      All error/warnings:
      arch/mips/kernel/mips-mt-fpaff.c: In function 'check_same_owner':
      arch/mips/kernel/mips-mt-fpaff.c:53:22: error: invalid operands to binary == (have 'kuid_t' and 'kuid_t')
      arch/mips/kernel/mips-mt-fpaff.c:54:15: error: invalid operands to binary == (have 'kuid_t' and 'kuid_t')
      
      Replace "a == b" with uid_eq(a, b) removes this error and allows the
      code to work with user namespaces enabled.
      
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      dd34ad35
  16. 09 11月, 2012 1 次提交
  17. 18 10月, 2012 1 次提交
  18. 16 10月, 2012 1 次提交
  19. 15 10月, 2012 2 次提交
  20. 13 10月, 2012 1 次提交
    • J
      vfs: define struct filename and have getname() return it · 91a27b2a
      Jeff Layton 提交于
      getname() is intended to copy pathname strings from userspace into a
      kernel buffer. The result is just a string in kernel space. It would
      however be quite helpful to be able to attach some ancillary info to
      the string.
      
      For instance, we could attach some audit-related info to reduce the
      amount of audit-related processing needed. When auditing is enabled,
      we could also call getname() on the string more than once and not
      need to recopy it from userspace.
      
      This patchset converts the getname()/putname() interfaces to return
      a struct instead of a string. For now, the struct just tracks the
      string in kernel space and the original userland pointer for it.
      
      Later, we'll add other information to the struct as it becomes
      convenient.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      91a27b2a
  21. 12 10月, 2012 1 次提交
    • J
      mips,kgdb: fix recursive page fault with CONFIG_KPROBES · f0a996ee
      Jason Wessel 提交于
      This fault was detected using the kgdb test suite on boot and it
      crashes recursively due to the fact that CONFIG_KPROBES on mips adds
      an extra die notifier in the page fault handler.  The crash signature
      looks like this:
      
      kgdbts:RUN bad memory access test
      KGDB: re-enter exception: ALL breakpoints killed
      Call Trace:
      [<807b7548>] dump_stack+0x20/0x54
      [<807b7548>] dump_stack+0x20/0x54
      
      The fix for now is to have kgdb return immediately if the fault type
      is DIE_PAGE_FAULT and allow the kprobe code to decide what is supposed
      to happen.
      
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      f0a996ee
  22. 11 10月, 2012 1 次提交