1. 31 7月, 2014 2 次提交
  2. 26 6月, 2014 2 次提交
    • M
      MIPS: MSC: Prevent out-of-bounds writes to MIPS SC ioremap'd region · ab6c15bc
      Markos Chandras 提交于
      Previously, the lower limit for the MIPS SC initialization loop was
      set incorrectly allowing one extra loop leading to writes
      beyond the MSC ioremap'd space. More precisely, the value of the 'imp'
      in the last loop increased beyond the msc_irqmap_t boundaries and
      as a result of which, the 'n' variable was loaded with an incorrect
      value. This value was used later on to calculate the offset in the
      MSC01_IC_SUP which led to random crashes like the following one:
      
      CPU 0 Unable to handle kernel paging request at virtual address e75c0200,
      epc == 8058dba4, ra == 8058db90
      [...]
      Call Trace:
      [<8058dba4>] init_msc_irqs+0x104/0x154
      [<8058b5bc>] arch_init_irq+0xd8/0x154
      [<805897b0>] start_kernel+0x220/0x36c
      
      Kernel panic - not syncing: Attempted to kill the idle task!
      
      This patch fixes the problem
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Reviewed-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7118/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ab6c15bc
    • P
      Revert "MIPS: Save/restore MSA context around signals" · 16f77de8
      Paul Burton 提交于
      This reverts commit eec43a22 "MIPS: Save/restore MSA context around
      signals" and the MSA parts of ca750649 "MIPS: kernel: signal:
      Prevent save/restore FPU context in user memory" (the restore path of
      which appears incorrect anyway...).
      
      The reverted patch took care not to break compatibility with userland
      users of struct sigcontext, but inadvertantly changed the offset of the
      uc_sigmask field of struct ucontext. Thus Linux v3.15 breaks the
      userland ABI. The MSA context will need to be saved via some other
      opt-in mechanism, but for now revert the change to reduce the fallout.
      
      This will have minimal impact upon use of MSA since the only supported
      CPU which includes it (the P5600) is 32-bit and therefore requires that
      the experimental CONFIG_MIPS_O32_FP64_SUPPORT Kconfig option be selected
      before the kernel will set FR=1 for a task, a requirement for MSA use.
      Thus the users of MSA are limited to known small groups of people & this
      patch won't be breaking any previously working MSA-using userland
      outside of experimental settings.
      
      [ralf@linux-mips.org: Fixed rejects.]
      
      Cc: stable@vger.kernel.org
      Reported-by: NJoseph S. Myers <joseph@codesourcery.com>
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7107/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      16f77de8
  3. 16 6月, 2014 2 次提交
  4. 04 6月, 2014 1 次提交
  5. 31 5月, 2014 3 次提交
    • D
      MIPS: Add function get_ebase_cpunum · 45b585c8
      David Daney 提交于
      This returns the CPUNum from the low order Ebase bits.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NAndreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: kvm@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7012/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      45b585c8
    • D
      MIPS: OCTEON: Enable use of FPU · a36d8225
      David Daney 提交于
      Some versions of the assembler will not assemble CFC1 for OCTEON, so
      override the ISA for these.
      
      Add r4k_fpu.o to handle low level FPU initialization.
      
      Modify octeon_switch.S to save the FPU registers.  And include
      r4k_switch.S to pick up more FPU support.
      
      Get rid of "#define cpu_has_fpu		0"
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NAndreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: kvm@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7006/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a36d8225
    • M
      MIPS: Implement random_get_entropy with CP0 Random · 06947aaa
      Maciej W. Rozycki 提交于
      Update to commit 9c9b415c [MIPS:
      Reimplement get_cycles().]
      
      On systems were for whatever reasons we can't use the cycle counter, fall
      back to the c0_random register as an entropy source.  It has however a
      very small range that makes it suitable for random_get_entropy only and
      not get_cycles.
      
      This optimised version compiles to 8 instructions in the fast path even in
      the worst case of all the conditions to check being variable (including a
      MFC0 move delay slot that is only required for very old processors):
      
           828:	8cf90000 	lw	t9,0(a3)
      			828: R_MIPS_LO16	jiffies
           82c:	40057800 	mfc0	a1,c0_prid
           830:	3c0200ff 	lui	v0,0xff
           834:	00a21024 	and	v0,a1,v0
           838:	1040007d 	beqz	v0,a30 <add_interrupt_randomness+0x22c>
           83c:	3c030000 	lui	v1,0x0
      			83c: R_MIPS_HI16	cpu_data
           840:	40024800 	mfc0	v0,c0_count
           844:	00000000 	nop
           848:	00409021 	move	s2,v0
           84c:	8ce20000 	lw	v0,0(a3)
      			84c: R_MIPS_LO16	jiffies
      
      On most targets the sequence will be shorter and on some it will reduce to
      a single `MFC0 <reg>,c0_count', as all MIPS architecture (i.e. non-legacy
      MIPS) processors require the CP0 Count register to be present.
      
      The only known exception that reports MIPS architecture compliance, but
      contrary to that lacks CP0 Count is the Ingenic JZ4740 thingy.  For broken
      platforms like that this code requires cpu_has_counter to be hardcoded to
      0 (i.e. no variable setting is permitted) so as not to penalise all the
      other good platforms out there.
      
      The asm barrier is required so that the compiler does not pull any
      potentially costly (cold cache!) `cpu_data' variable access into the fast
      path.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Andrew McGregor <andrewmcgr@gmail.com>
      Cc: Dave Taht <dave.taht@bufferbloat.net>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Simon Kelley <simon@thekelleys.org.uk>
      Cc: Jim Gettys <jg@freedesktop.org>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6702/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      06947aaa
  6. 30 5月, 2014 1 次提交
  7. 28 5月, 2014 12 次提交
    • P
      cpuidle: cpuidle-cps: add MIPS CPS cpuidle driver · d0508944
      Paul Burton 提交于
      This patch adds a cpuidle driver for systems based around the MIPS
      Coherent Processing System (CPS) architecture. It supports four idle
      states:
      
        - The standard MIPS wait instruction.
      
        - The non-coherent wait, clock gated & power gated states exposed by
          the recently added pm-cps layer.
      
      The pm-cps layer is used to enter all the deep idle states. Since cores
      in the clock or power gated states cannot service interrupts, the
      gic_send_ipi_single function is modified to send a power up command for
      the appropriate core to the CPC in cases where the target CPU has marked
      itself potentially incoherent.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      d0508944
    • P
      MIPS: cpuidle wait instruction state · da9f970f
      Paul Burton 提交于
      Defines a macro intended to allow trivial use of the regular MIPS wait
      instruction from cpuidle drivers, which may simply invoke the macro
      within their array of states.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      da9f970f
    • P
      MIPS: smp-cps: duplicate core0 CCA on secondary cores · 0155a065
      Paul Burton 提交于
      Rather than hardcoding CCA=0x5 for secondary cores, re-use the CCA from
      the boot CPU. This allows overrides of the CCA using the cca= kernel
      parameter to take effect on all CPUs for consistency.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      0155a065
    • P
      MIPS: smp-cps: set a coherent default CCA · 33b68665
      Paul Burton 提交于
      This patch sets a default CCA suited for use with multi-core SMP on all
      current MIPS CPS based systems. It may still be overriden by the cca=
      argument on the kernel command line.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      33b68665
    • P
      MIPS: smp-cps: prevent multi-core SMP with unsuitable CCA · 5c399f6e
      Paul Burton 提交于
      If the user or bootloader sets the CCA to a value which is not suited
      for multi-core SMP (ie. anything non-coherent) then limit the system to
      using only a single core and warn the user.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      5c399f6e
    • P
      MIPS: smp-cps: hotplug support · 1d8f1f5a
      Paul Burton 提交于
      This patch adds support for offlining CPUs via hotplug when using the
      CONFIG_MIPS_CPS SMP implementation. When a CPU is offlined one of 2
      things will happen:
      
        - If the CPU is part of a core which implements the MT ASE and there
          is at least one other VPE online within that core then the VPE will
          be halted by settings its TCHalt bit.
      
        - Otherwise if supported the core will be powered down via the CPC.
      
        - Otherwise the CPU will hang by executing an infinite loop.
      
      Bringing CPUs back online is then a process of either clearing the
      appropriate VPEs TCHalt bit or powering up the appropriate core via the
      CPC. Throughout the process the struct core_boot_config vpe_mask field
      must be maintained such that mips_cps_boot_vpes will start & stop the
      correct VPEs.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      1d8f1f5a
    • P
      MIPS: pm-cps: add PM state entry code for CPS systems · 3179d37e
      Paul Burton 提交于
      This patch adds code to generate entry & exit code for various low power
      states available on systems based around the MIPS Coherent Processing
      System architecture (ie. those with a Coherence Manager, Global
      Interrupt Controller & for >=CM2 a Cluster Power Controller). States
      supported are:
      
        - Non-coherent wait. This state first leaves the coherent domain and
          then executes a regular MIPS wait instruction. Power savings are
          found from the elimination of coherency interventions between the
          core and any other coherent requestors in the system.
      
        - Clock gated. This state leaves the coherent domain and then gates
          the clock input to the core. This removes all dynamic power from the
          core but leaves the core at the mercy of another to restart its
          clock. Register state is preserved, but the core can not service
          interrupts whilst its clock is gated.
      
        - Power gated. This deepest state removes all power input to the core.
          All register state is lost and the core will restart execution from
          its BEV when another core powers it back up. Because register state
          is lost this state requires cooperation with the CONFIG_MIPS_CPS SMP
          implementation in order for the core to exit the state successfully.
      
      The code will detect which states are available on the current system
      during boot & generate the entry/exit code for those states. This will
      be used by cpuidle & hotplug implementations.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      3179d37e
    • P
      MIPS: smp-cps: use CPC core-other locking · dd9233d0
      Paul Burton 提交于
      The core which the CPC core-other region relates to is based upon the
      core-local core-other addressing register. As its name suggests this
      register is shared between all VPEs within a core, and if there is a
      possibility that multiple VPEs within a core will attempt to access
      another core simultaneously then locking is required. This wasn't
      previously a problem with the only user being cpu0 during boot, but will
      be an issue once hotplug is implemented & may race with other users such
      as cpuidle.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      dd9233d0
    • P
      MIPS: smp-cps: flush cache after patching mips_cps_core_entry · 0f4d3d11
      Paul Burton 提交于
      The start of mips_cps_core_entry is patched in order to provide the code
      with the address of the CM register region at a point where it will be
      running non-coherent with the rest of the system. However the cache
      wasn't being flushed after that patching which could in principle lead
      to secondary cores using an invalid CM base address.
      
      The patching is moved to cps_prepare_cpus since local_flush_icache_range
      has not been initialised at the point cps_smp_setup is called.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      0f4d3d11
    • P
      MIPS: smp-cps: function to determine whether CPS SMP is in use · 68c1232f
      Paul Burton 提交于
      The core power down state for cpuidle will require that the CPS SMP
      implementation is in use. This patch provides a mips_cps_smp_in_use
      function which determines whether or not the CPS SMP implementation is
      currently in use.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      68c1232f
    • P
      MIPS: smp-cps: rework core/VPE initialisation · 245a7868
      Paul Burton 提交于
      When hotplug and/or a powered down idle state are supported cases will
      arise where a non-zero VPE must be brought online without VPE 0, and it
      where multiple VPEs must be onlined simultaneously. This patch prepares
      for that by:
      
        - Splitting struct boot_config into core & VPE boot config structures,
          allocated one per core or VPE respectively. This allows for multiple
          VPEs to be onlined simultaneously without clobbering each others
          configuration.
      
        - Indicating which VPEs should be online within a core at any given
          time using a bitmap. This allows multiple VPEs to be brought online
          simultaneously and also indicates to VPE 0 whether it should halt
          after starting any non-zero VPEs that should be online within the
          core. For example if all VPEs within a core are offlined via hotplug
          and the user onlines the second VPE within that core:
      
            1) The core will be powered up.
      
            2) VPE 0 will run from the BEV (ie. mips_cps_core_entry) to
               initialise the core.
      
            3) VPE 0 will start VPE 1 because its bit is set in the cores
               bitmap.
      
            4) VPE 0 will halt itself because its bit is clear in the cores
               bitmap.
      
        - Moving the core & VPE initialisation to assembly code which does not
          make any use of the stack. This is because if a non-zero VPE is to
          be brought online in a powered down core then when VPE 0 of that
          core runs it may not have a valid stack, and even if it did then
          it's messy to run through parts of generic kernel code on VPE 0
          before starting the correct VPE.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      245a7868
    • A
      MIPS: ptrace: Avoid smp_processor_id() in preemptible code · 57c7ea51
      Alex Smith 提交于
      ptrace_{get,set}_watch_regs access current_cpu_data to get the watch
      register count/masks, which calls smp_processor_id(). However they are
      run in preemptible context and therefore trigger warnings like so:
      
      [ 6340.092000] BUG: using smp_processor_id() in preemptible [00000000] code: gdb/367
      [ 6340.092000] caller is ptrace_get_watch_regs+0x44/0x220
      
      Since the watch register count/masks should be the same across all
      CPUs, use boot_cpu_data instead. Note that this may need to change in
      future should a heterogenous system be supported where the count/masks
      are not the same across all CPUs (the current code is also incorrect
      for this scenario - current_cpu_data here would not necessarily be
      correct for the CPU that the target task will execute on).
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Reviewed-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/6879/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      57c7ea51
  8. 27 5月, 2014 1 次提交
  9. 25 5月, 2014 1 次提交
  10. 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
  11. 23 5月, 2014 4 次提交
  12. 13 5月, 2014 2 次提交
  13. 02 5月, 2014 8 次提交