1. 13 5月, 2015 1 次提交
  2. 08 4月, 2015 10 次提交
  3. 31 3月, 2015 2 次提交
    • J
      MIPS: Read CPU IRQ line that FDC to routed to · 8f7ff027
      James Hogan 提交于
      Read the CPU IRQ line reportedly used for the Fast Debug Channel (FDC)
      interrupt from the IntCtl register and store it in cp0_fdc_irq where
      platform implementations of the new weak platform function
      get_c0_fdc_int() can refer to it.
      
      [ralf@linux-mips.org: Fixed conflict.]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/9140/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8f7ff027
    • J
      MIPS: Allow shared IRQ for timer & perf counter · 4a91d8fb
      James Hogan 提交于
      Before release 2 of the architecture there weren't separate interrupt
      pending bits for the local CPU interrupts (timer & perf counter
      overflow), so when they were connected to the same interrupt line the
      timer handler had to call the performance counter handler before knowing
      whether a timer interrupt was actually pending.
      
      Now another CPU local interrupt, for the Fast Debug Channel (FDC), can
      also be routed to an arbitrary interrupt line. It isn't scalable to keep
      adding cross-calls between handlers for these cases of shared interrupt
      lines, especially since the FDC could in theory share its interrupt line
      with the performance counter, timer, or both.
      
      Fortunately since release 2 of the architecture separate interrupt
      pending bits do exist in the Cause register. This allows local
      interrupts which share an interrupt line to have separate handlers using
      IRQF_SHARED. Unfortunately they can't easily have their own irqchip as
      there is no generic way to individually mask them.
      
      Enable this sharing to happen by removing the special case for when the
      perf count shares an IRQ with the timer. cp0_perfcount_irq and
      cp0_compare_irq can then be set to the same value with shared interrupt
      handlers registered for both of them.
      
      Pre-R2 code should be unaffected. cp0_perfcount_irq will always be -1
      and the timer handler will contnue to call into the perf counter
      handler.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/9131/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4a91d8fb
  4. 28 3月, 2015 2 次提交
    • J
      MIPS: Clear [MSA]FPE CSR.Cause after notify_die() · 64bedffe
      James Hogan 提交于
      When handling floating point exceptions (FPEs) and MSA FPEs the Cause
      bits of the appropriate control and status register (FCSR for FPEs and
      MSACSR for MSA FPEs) are read and cleared before enabling interrupts,
      presumably so that it doesn't have to go through the pain of restoring
      those bits if the process is pre-empted, since writing those bits would
      cause another immediate exception while still in the kernel.
      
      The bits aren't normally ever restored again, since userland never
      expects to see them set.
      
      However for virtualisation it is necessary for the kernel to be able to
      restore these Cause bits, as the guest may have been interrupted in an
      FP exception handler but before it could read the Cause bits. This can
      be done by registering a die notifier, to get notified of the exception
      when such a value is restored, and if the PC was at the instruction
      which is used to restore the guest state, the handler can step over it
      and continue execution. The Cause bits can then remain set without
      causing further exceptions.
      
      For this to work safely a few changes are made:
      - __build_clear_fpe and __build_clear_msa_fpe no longer clear the Cause
        bits, and now return from exception level with interrupts disabled
        instead of enabled.
      - do_fpe() now clears the Cause bits and enables interrupts after
        notify_die() is called, so that the notifier can chose to return from
        exception without this happening.
      - do_msa_fpe() acts similarly, but now actually makes use of the second
        argument (msacsr) and calls notify_die() with the new DIE_MSAFP,
        allowing die notifiers to be informed of MSA FPEs too.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      64bedffe
    • P
      MIPS: Ensure FCSR cause bits are clear after invoking FPU emulator · ad70c13a
      Paul Burton 提交于
      When running the emulator to handle an instruction that raised an FP
      unimplemented operation exception, the FCSR cause bits were being
      cleared. This is done to ensure that the kernel does not take an FP
      exception when later restoring FP context to registers. However, this
      was not being done when the emulator is invoked in response to a
      coprocessor unusable exception. This happens in 2 cases:
      
        - There is no FPU present in the system. In this case things were
          OK, since the FP context is never restored to hardware registers
          and thus no FP exception may be raised when restoring FCSR.
      
        - The FPU could not be configured to the mode required by the task.
          In this case it would be possible for the emulator to set cause
          bits which are later restored to hardware if the task migrates
          to a CPU whose associated FPU does support its mode requirements,
          or if the tasks FP mode requirements change.
      
      Consistently clear the cause bits after invoking the emulator, by moving
      the clearing to process_fpemu_return and ensuring this is always called
      before the tasks FP context is restored. This will make it easier to
      catch further paths invoking the emulator in future, as will be
      introduced in further patches.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9165/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ad70c13a
  5. 05 3月, 2015 1 次提交
  6. 17 2月, 2015 3 次提交
  7. 16 2月, 2015 1 次提交
  8. 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
  9. 31 1月, 2015 1 次提交
    • J
      MIPS: traps: Fix inline asm ctc1 missing .set hardfloat · d76e9b9f
      James Hogan 提交于
      Commit 842dfc11 ("MIPS: Fix build with binutils 2.24.51+") in v3.18
      enabled -msoft-float and sprinkled ".set hardfloat" where necessary to
      use FP instructions. However it missed enable_restore_fp_context() which
      since v3.17 does a ctc1 with inline assembly, causing the following
      assembler errors on Mentor's 2014.05 toolchain:
      
      {standard input}: Assembler messages:
      {standard input}:2913: Error: opcode not supported on this processor: mips32r2 (mips32r2) `ctc1 $2,$31'
      scripts/Makefile.build:257: recipe for target 'arch/mips/kernel/traps.o' failed
      
      Fix that to use the new write_32bit_cp1_register() macro so that ".set
      hardfloat" is automatically added when -msoft-float is in use.
      
      Fixes 842dfc11 ("MIPS: Fix build with binutils 2.24.51+")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 3.18+, depends on "MIPS: mipsregs.h: Add write_32bit_cp1_register()"
      Patchwork: https://patchwork.linux-mips.org/patch/9173/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d76e9b9f
  10. 24 11月, 2014 4 次提交
  11. 02 8月, 2014 5 次提交
  12. 04 6月, 2014 1 次提交
  13. 25 5月, 2014 1 次提交
  14. 24 5月, 2014 1 次提交
    • R
      MIPS: MT: Remove SMTC support · b633648c
      Ralf Baechle 提交于
      Nobody is maintaining SMTC anymore and there also seems to be no userbase.
      Which is a pity - the SMTC technology primarily developed by Kevin D.
      Kissell <kevink@paralogos.com> is an ingenious demonstration for the MT
      ASE's power and elegance.
      
      Based on Markos Chandras <Markos.Chandras@imgtec.com> patch
      https://patchwork.linux-mips.org/patch/6719/ which while very similar did
      no longer apply cleanly when I tried to merge it plus some additional
      post-SMTC cleanup - SMTC was a feature as tricky to remove as it was to
      merge once upon a time.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b633648c
  15. 02 5月, 2014 1 次提交
  16. 27 3月, 2014 5 次提交