1. 15 5月, 2018 1 次提交
    • M
      MIPS: Probe for MIPS MT perf counters per TC · 8270ab48
      Matt Redfearn 提交于
      Processors implementing the MIPS MT ASE may have performance counters
      implemented per core or per TC. Processors implemented by MIPS
      Technologies signify presence per TC through a bit in the implementation
      specific Config7 register. Currently the code which probes for their
      presence blindly reads a magic number corresponding to this bit, despite
      it potentially having a different meaning in the CPU implementation.
      
      Since CPU features are generally detected by cpu-probe.c, perform the
      detection here instead. Introduce cpu_set_mt_per_tc_perf which checks
      the bit in config7 and call it from MIPS CPUs known to implement this
      bit and the MT ASE, specifically, the 34K, 1004K and interAptiv.
      
      Once the presence of the per-tc counter is indicated in cpu_data, tests
      for it can be updated to use this flag.
      Suggested-by: NJames Hogan <jhogan@kernel.org>
      Signed-off-by: NMatt Redfearn <matt.redfearn@mips.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Matt Redfearn <matt.redfearn@mips.com>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Maciej W. Rozycki <macro@mips.com>
      Cc: linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/19136/Signed-off-by: NJames Hogan <jhogan@kernel.org>
      8270ab48
  2. 20 2月, 2018 1 次提交
  3. 30 8月, 2017 3 次提交
    • P
      MIPS: Add CPU cluster number accessors · 5616897e
      Paul Burton 提交于
      Introduce cpu_cluster() & cpu_set_cluster() accessor functions in the
      same vein as cpu_core(), cpu_vpe_id() & their set variants. These will
      be used in further patches to allow users to get or set a CPUs cluster
      number.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17012/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5616897e
    • P
      MIPS: Store core & VP IDs in GlobalNumber-style variable · 856fbcee
      Paul Burton 提交于
      This patch modifies the way we store core & VP IDs such that we store
      them in a single 32 bit integer whose format matches that of the MIPSr6
      GlobalNumber register. Whereas we have previously stored core & VP IDs
      in separate fields, storing them in a single GlobalNumber-like field:
      
        1) Reduces the size of struct cpuinfo_mips by 4 bytes, and will allow
           it to not grow when cluster support is added.
      
        2) Gives us a natural place to store cluster number, which matches up
           with what the architecture provides.
      
        3) Will be useful in the future as a parameter to the MIPSr6 GINVI
           instruction to specify a target CPU whose icache that instruction
           should operate on.
      
      The cpu_set*() accessor functions are moved out of the asm/cpu-info.h
      header in order to allow them to use the WARN_ON macro, which is
      unusable in asm/cpu-info.h due to include ordering.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17010/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      856fbcee
    • P
      MIPS: Abstract CPU core & VP(E) ID access through accessor functions · f875a832
      Paul Burton 提交于
      We currently have fields in struct cpuinfo_mips for the core & VP(E) ID
      of a particular CPU, and various pieces of code directly access those
      fields. This patch abstracts such access by introducing accessor
      functions cpu_core(), cpu_set_core(), cpu_vpe_id() & cpu_set_vpe_id()
      and having code that needs to access these values call those functions
      rather than directly accessing the struct cpuinfo_mips fields. This
      prepares us for changes to the way in which those values are stored in
      later patches.
      
      The cpu_vpe_id() function is introduced even though we already had a
      cpu_vpe_id() macro for a couple of reasons:
      
        1) It's more consistent with the core, and future cluster, accessors.
      
        2) It ensures a sensible return type without explicit casts.
      
        3) It's generally preferable to use functions rather than macros.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17009/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f875a832
  4. 29 8月, 2017 2 次提交
    • P
      MIPS: Declare various variables & functions static · b7fc2cc5
      Paul Burton 提交于
      We currently have various variables & functions which are only used
      within a single translation unit, but which we don't declare static.
      This causes various sparse warnings of the form:
      
        arch/mips/kernel/mips-r2-to-r6-emul.c:49:1: warning: symbol
          'mipsr2emustats' was not declared. Should it be static?
      
        arch/mips/kernel/unaligned.c:1381:11: warning: symbol 'reg16to32st'
          was not declared. Should it be static?
      
        arch/mips/mm/mmap.c:146:15: warning: symbol 'arch_mmap_rnd' was not
          declared. Should it be static?
      
      Fix these & others by declaring various affected variables & functions
      static, avoiding the sparse warnings & redundant symbols.
      
      [ralf@linux-mips.org: Add Marcin's build fix.]
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: trivial@kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/17176/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b7fc2cc5
    • P
      MIPS: Remove unused R6000 support · 3b2db173
      Paul Burton 提交于
      The kernel contains a small amount of incomplete code aimed at
      supporting old R6000 CPUs. This is:
      
        - Unused, as no machine selects CONFIG_SYS_HAS_CPU_R6000.
      
        - Broken, since there are glaring errors such as r6000_fpu.S moving
          the FCSR register to t1, then ignoring it & instead saving t0 into
          struct sigcontext...
      
        - A maintenance headache, since it's code that nobody can test which
          nevertheless imposes constraints on code which it shares with other
          machines.
      
      Remove this incomplete & broken R6000 CPU support in order to clean up
      and in preparation for changes which will no longer need to consider
      dragging the pretense of R6000 support along with them.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16236/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3b2db173
  5. 05 7月, 2017 1 次提交
  6. 29 6月, 2017 1 次提交
  7. 28 6月, 2017 2 次提交
    • H
      MIPS: Loongson: Add Loongson-3A R3 basic support · 0a00024d
      Huacai Chen 提交于
      Loongson-3A R3 is very similar to Loongson-3A R2.
      
      All Loongson-3 CPU family:
      
      Code-name       Brand-name       PRId
      Loongson-3A R1  Loongson-3A1000  0x6305
      Loongson-3A R2  Loongson-3A2000  0x6308
      Loongson-3A R3  Loongson-3A3000  0x6309
      Loongson-3B R1  Loongson-3B1000  0x6306
      Loongson-3B R2  Loongson-3B1500  0x6307
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J . Hill <Steven.Hill@cavium.com>
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16585/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      0a00024d
    • P
      MIPS: Probe the I6500 CPU · 859aeb1b
      Paul Burton 提交于
      Introduce the I6500 PRID & probe it just the same way as I6400. The MIPS
      I6500 is the latest in Imagination Technologies' I-Class range of CPUs,
      with a focus on scalability & heterogeneity. It introduces the notion of
      multiple clusters to the MIPS Coherent Processing System, allowing for a
      far higher total number of cores & threads in a system when compared
      with its predecessors. Clusters don't need to be identical, and may
      contain differing numbers of cores & IOCUs, or cores with differing
      properties.
      
      This patch alone adds the basic support for booting Linux on an I6500
      CPU without support for any of its new functionality, for which support
      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/16190/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      859aeb1b
  8. 10 4月, 2017 1 次提交
  9. 28 3月, 2017 3 次提交
    • J
      MIPS: Probe guest MVH · a929bdc5
      James Hogan 提交于
      Probe for availablility of M{T,F}HC0 instructions used with e.g. XPA in
      the VZ guest context, and make it available via cpu_guest_has_mvh. This
      will be helpful in properly emulating the MAAR registers in KVM for MIPS
      VZ.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      a929bdc5
    • J
      MIPS: Probe guest CP0_UserLocal · a7c7ad6c
      James Hogan 提交于
      Probe for presence of guest CP0_UserLocal register and expose via
      cpu_guest_has_userlocal. This register is optional pre-r6, so this will
      allow KVM to only save/restore/expose the guest CP0_UserLocal register
      if it exists.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      a7c7ad6c
    • J
      MIPS: Add defs & probing of UFR · 4e87580e
      James Hogan 提交于
      Add definitions and probing of the UFR bit in Config5. This bit allows
      user mode control of the FR bit (floating point register mode). It is
      present if the UFRP bit is set in the floating point implementation
      register.
      
      This is a capability KVM may want to expose to guest kernels, even
      though Linux is unlikely to ever use it due to the implications for
      multi-threaded programs.
      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: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      4e87580e
  10. 22 3月, 2017 1 次提交
  11. 25 12月, 2016 1 次提交
  12. 30 9月, 2016 3 次提交
    • P
      MIPS: clear execution hazard after changing FTLB enable · 67acd8d5
      Paul Burton 提交于
      On current P-series cores from Imagination the FTLB can be enabled or
      disabled via a bit in the Config6 register, and an execution hazard is
      created by changing the value of bit. The ftlb_disable function already
      cleared that hazard but that does no good for other callers. Clear the
      hazard in the set_ftlb_enable function that creates it, and only for the
      cores where it applies.
      
      This has the effect of reverting c982c6d6 ("MIPS: cpu-probe: Remove
      cp0 hazard barrier when enabling the FTLB") which was incorrect.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: c982c6d6 ("MIPS: cpu-probe: Remove cp0 hazard barrier when enabling the FTLB")
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14023/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      67acd8d5
    • P
      MIPS: Configure FTLB after probing TLB sizes from config4 · ebd0e0f5
      Paul Burton 提交于
      On some cores (proAptiv, P5600) we make use of the sizes of the TLBs
      to determine the desired FTLB:VTLB write ratio. However set_ftlb_enable
      & thus calculate_ftlb_probability is called before decode_config4. This
      results in us calculating a probability based on zero sizes, and we end
      up setting FTLBP=3 for a 3:1 FTLB:VTLB write ratio in all cases. This
      will make abysmal use of the available FTLB resources in the affected
      cores.
      
      Fix this by configuring the FTLB probability after having decoded
      config4. However we do need to have enabled the FTLB before that point
      such that fields in config4 actually reflect that an FTLB is present. So
      set_ftlb_enable is now called twice, with flags indicating that it
      should configure the write probability only the second time.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: cf0a8aa0 ("MIPS: cpu-probe: Set the FTLB probability bit on supported cores")
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14022/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ebd0e0f5
    • P
      MIPS: Stop setting I6400 FTLBP · 72c70f01
      Paul Burton 提交于
      The FTLBP field in Config7 for the I6400 is intended as chicken bits for
      debugging rather than as a field that software actually makes use of.
      For best performance, FTLBP should be left at its default value of 0
      with all TLB writes hitting the FTLB by default.
      
      Additionally, since set_ftlb_enable is called from decode_configs before
      decode_config4 which determines the size of the TLBs, this was
      previously always setting FTLBP=3 for a 3:1 FTLB:VTLB write ratio which
      makes abysmal use of the available FTLB resources.
      
      This effectively reverts b0c4e1b79d8a ("MIPS: Set up FTLB probability
      for I6400").
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: b0c4e1b79d8a ("MIPS: Set up FTLB probability for I6400")
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14021/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      72c70f01
  13. 28 5月, 2016 1 次提交
  14. 13 5月, 2016 19 次提交