1. 16 9月, 2008 1 次提交
    • M
      powerpc: Add new CPU feature: CPU_FTR_CP_USE_DCBTZ · 2a929436
      Mark Nelson 提交于
      Add a new CPU feature bit, CPU_FTR_CP_USE_DCBTZ, to be added to the
      64bit powerpc chips that benefit from having dcbt and dcbz
      instructions used in their memory copy routines.
      
      This will be used in a subsequent patch that updates copy_4K_page().
      The new bit is added to Cell, PPC970 and Power4 because they show
      better performance with the new copy_4K_page() when dcbt and dcbz
      instructions are used.
      Signed-off-by: NMark Nelson <markn@au1.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      2a929436
  2. 20 8月, 2008 1 次提交
  3. 04 8月, 2008 1 次提交
  4. 25 7月, 2008 1 次提交
  5. 15 7月, 2008 1 次提交
    • N
      powerpc: Add PPC_FEATURE_PSERIES_PERFMON_COMPAT · 0f473314
      Nathan Lynch 提交于
      Background from Maynard Johnson:
      As of POWER6, a set of 32 common events is defined that must be
      supported on all future POWER processors.  The main impetus for this
      compat set is the need to support partition migration, especially from
      processor P(n) to processor P(n+1), where performance software that's
      running in the new partition may not be knowledgeable about processor
      P(n+1).  If a performance tool determines it does not support the
      physical processor, but is told (via the
      PPC_FEATURE_PSERIES_PERFMON_COMPAT bit) that the processor supports
      the notion of the PMU compat set, then the performance tool can
      surface just those events to the user of the tool.
      
      PPC_FEATURE_PSERIES_PERFMON_COMPAT indicates that the PMU supports at
      least this basic subset of events which is compatible across POWER
      processor lines.
      Signed-off-by: NNathan Lynch <ntl@pobox.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0f473314
  6. 09 7月, 2008 1 次提交
  7. 03 7月, 2008 1 次提交
    • K
      powerpc: Fixup lwsync at runtime · 2d1b2027
      Kumar Gala 提交于
      To allow for a single kernel image on e500 v1/v2/mc we need to fixup lwsync
      at runtime.  On e500v1/v2 lwsync causes an illop so we need to patch up
      the code.  We default to 'sync' since that is always safe and if the cpu
      is capable we will replace 'sync' with 'lwsync'.
      
      We introduce CPU_FTR_LWSYNC as a way to determine at runtime if this is
      needed.  This flag could be moved elsewhere since we dont really use it
      for the normal CPU_FTR purpose.
      
      Finally we only store the relative offset in the fixup section to keep it
      as small as possible rather than using a full fixup_entry.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      2d1b2027
  8. 01 7月, 2008 3 次提交
  9. 30 6月, 2008 1 次提交
  10. 26 6月, 2008 2 次提交
  11. 19 6月, 2008 1 次提交
    • K
      powerpc/booke: Add support for new e500mc core · 3dfa8773
      Kumar Gala 提交于
      The new e500mc core from Freescale is based on the e500v2 but with the
      following changes:
      
      * Supports only the Enhanced Debug Architecture (DSRR0/1, etc)
      * Floating Point
      * No SPE
      * Supports lwsync
      * Doorbell Exceptions
      * Hypervisor
      * Cache line size is now 64-bytes (e500v1/v2 have a 32-byte cache line)
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      3dfa8773
  12. 06 2月, 2008 1 次提交
  13. 24 12月, 2007 1 次提交
  14. 13 11月, 2007 1 次提交
    • B
      [POWERPC] Avoid unpaired stwcx. on some processors · b64f87c1
      Becky Bruce 提交于
      The context switch code in the kernel issues a dummy stwcx. to clear the
      reservation, as recommended by the architecture.  However, some processors
      can have issues if this stwcx to address A occurs while the reservation
      is already held to a different address B.  To avoid this problem, the dummy
      stwcx. needs to be paired with a dummy lwarx to the same address.
      
      This adds the dummy lwarx, and creates a cpu feature bit to indicate
      which cpus are affected.  Tested on mpc8641_hpcn_defconfig in
      arch/powerpc; build tested in arch/ppc.
      Signed-off-by: NBecky Bruce <becky.bruce@freescale.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b64f87c1
  15. 17 10月, 2007 1 次提交
    • O
      [POWERPC] Add 1TB workaround for PA6T · f66bce5e
      Olof Johansson 提交于
      PA6T has a bug where the slbie instruction does not honor the large
      segment bit.  As a result, we have to always use slbia when switching
      context.
      
      We don't have to worry about changing the slbie's during fault processing,
      since they should never be replacing one VSID with another using the
      same ESID.  I.e. there's no risk for inserting duplicate entries due to a
      failed slbie of the old entry.  So as long as we clear it out on context
      switch we should be fine.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f66bce5e
  16. 12 10月, 2007 1 次提交
    • P
      [POWERPC] Use 1TB segments · 1189be65
      Paul Mackerras 提交于
      This makes the kernel use 1TB segments for all kernel mappings and for
      user addresses of 1TB and above, on machines which support them
      (currently POWER5+, POWER6 and PA6T).
      
      We detect that the machine supports 1TB segments by looking at the
      ibm,processor-segment-sizes property in the device tree.
      
      We don't currently use 1TB segments for user addresses < 1T, since
      that would effectively prevent 32-bit processes from using huge pages
      unless we also had a way to revert to using 256MB segments.  That
      would be possible but would involve extra complications (such as
      keeping track of which segment size was used when HPTEs were inserted)
      and is not addressed here.
      
      Parts of this patch were originally written by Ben Herrenschmidt.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1189be65
  17. 11 10月, 2007 1 次提交
    • P
      [POWERPC] Fix performance monitor on machines with logical PVR · 87a72f9e
      Paul Mackerras 提交于
      Some IBM machines supply a "logical" PVR (processor version register)
      value in the device tree in the cpu nodes rather than the real PVR.
      This is used for instance to indicate that the processors in a POWER6
      partition have been configured by the hypervisor to run in POWER5+
      mode rather than POWER6 mode.  To cope with this, we call identify_cpu
      a second time with the logical PVR value (the first call is with the
      real PVR value in the very early setup code).
      
      However, POWER5+ machines can also supply a logical PVR value, and use
      the same value (the value that indicates a v2.04 architecture
      compliant processor).  This causes problems for code that uses the
      performance monitor (such as oprofile), because the PMU registers are
      different in POWER6 (even in POWER5+ mode) from the real POWER5+.
      
      This change works around this problem by taking out the PMU
      information from the cputable entries for the logical PVR values, and
      changing identify_cpu so that the second call to it won't overwrite
      the PMU information that was established by the first call (the one
      with the real PVR), but does update the other fields.  Specifically,
      if the cputable entry for the logical PVR value has num_pmcs == 0,
      none of the PMU-related fields get used.
      
      So that we can create a mixed cputable entry, we now make cur_cpu_spec
      point to a single static struct cpu_spec, and copy stuff from
      cpu_specs[i] into it.  This has the side-effect that we can now make
      cpu_specs[] be initdata.
      
      Ultimately it would be good to move the PMU-related fields out to a
      separate structure, pointed to by the cputable entries, and change
      identify_cpu so that it saves the PMU info pointer, copies the whole
      structure, and restores the PMU info pointer, rather than identify_cpu
      having to list all the fields that are *not* PMU-related.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      87a72f9e
  18. 05 10月, 2007 1 次提交
  19. 14 9月, 2007 1 次提交
  20. 10 7月, 2007 1 次提交
  21. 14 6月, 2007 1 次提交
    • D
      [POWERPC] Merge CPU features pertaining to icache coherency · 4508dc21
      David Gibson 提交于
      Currently the powerpc kernel has a 64-bit only feature,
      COHERENT_ICACHE used for those CPUS which maintain icache/dcache
      coherency in hardware (POWER5, essentially).  It also has a feature,
      SPLIT_ID_CACHE, which is used on CPUs which have separate i and
      d-caches, which is to say everything except 601 and Freescale E200.
      
      In nearly all the places we check the SPLIT_ID_CACHE, what we actually
      care about is whether the i and d-caches are coherent (which they will
      be, trivially, if they're the same cache).
      
      This tries to clarify the situation a little.  The COHERENT_ICACHE
      feature becomes availble on 32-bit and is set for all CPUs where i and
      d-cache are effectively coherent, whether this is due to special logic
      (POWER5) or because they're unified.  We check this, instead of
      SPLIT_ID_CACHE nearly everywhere.
      
      The SPLIT_ID_CACHE feature itself is replaced by a UNIFIED_ID_CACHE
      feature with reversed sense, set only on 601 and Freescale E200.  In
      the two places (one Freescale BookE specific) where we really care
      whether it's a unified cache, not whether they're coherent, we check
      this feature.  The CPUs with unified cache are so few, we could
      consider replacing this feature bit with explicit checks against the
      PVR.
      
      This will make unifying the 32-bit and 64-bit cache flush code a
      little more straightforward.
      Signed-off-by: NDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      4508dc21
  22. 17 5月, 2007 1 次提交
  23. 24 4月, 2007 2 次提交
  24. 07 2月, 2007 2 次提交
  25. 09 12月, 2006 1 次提交
  26. 08 12月, 2006 1 次提交
    • K
      [POWERPC] Add support for FP emulation for the e300c2 core · aa42c69c
      Kim Phillips 提交于
      The e300c2 has no FPU.  Its MSR[FP] is grounded to zero.  If an attempt
      is made to execute a floating point instruction (including floating-point
      load, store, or move instructions), the e300c2 takes a floating-point
      unavailable interrupt.
      
      This patch adds support for FP emulation on the e300c2 by declaring a
      new CPU_FTR_FP_TAKES_FPUNAVAIL, where FP unavail interrupts are
      intercepted and redirected to the ProgramCheck exception path for
      correct emulation handling.
      
      (If we run out of CPU_FTR bits we could look to reclaim this bit by adding
      support to test the cpu_user_features for PPC_FEATURE_HAS_FPU instead)
      
      It adds a nop to the exception path for 32-bit processors with a FPU.
      Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      aa42c69c
  27. 04 12月, 2006 4 次提交
    • S
      [POWERPC] Fix cputable.h for combined build · 0470466d
      Stephen Rothwell 提交于
      Remove CPU_FTR_16M_PAGE from the cupfeatures mask at runtime on iSeries.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0470466d
    • M
      [POWERPC] Make 64-bit cpu features defined on 32-bit · 0b8e2e13
      Michael Ellerman 提交于
      It saves #ifdef'ing in callers if we at least define the 64-bit cpu
      features for 32-bit also.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      0b8e2e13
    • P
      [POWERPC] Distinguish POWER6 partition modes and tell userspace · 974a76f5
      Paul Mackerras 提交于
      This adds code to look at the properties firmware puts in the device
      tree to determine what compatibility mode the partition is in on
      POWER6 machines, and set the ELF aux vector AT_HWCAP and AT_PLATFORM
      entries appropriately.
      
      Specifically, we look at the cpu-version property in the cpu node(s).
      If that contains a "logical" PVR value (of the form 0x0f00000x), we
      call identify_cpu again with this PVR value.  A value of 0x0f000001
      indicates the partition is in POWER5+ compatibility mode, and a value
      of 0x0f000002 indicates "POWER6 architected" mode, with various
      extensions disabled.  We also look for various other properties:
      ibm,dfp, ibm,purr and ibm,spurr.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      974a76f5
    • M
      [POWERPC] cell: Add oprofile support · 18f2190d
      Maynard Johnson 提交于
      Add PPU event-based and cycle-based profiling support to Oprofile for Cell.
      
      Oprofile is expected to collect data on all CPUs simultaneously.
      However, there is one set of performance counters per node.  There are
      two hardware threads or virtual CPUs on each node.  Hence, OProfile must
      multiplex in time the performance counter collection on the two virtual
      CPUs.
      
      The multiplexing of the performance counters is done by a virtual
      counter routine.  Initially, the counters are configured to collect data
      on the even CPUs in the system, one CPU per node.  In order to capture
      the PC for the virtual CPU when the performance counter interrupt occurs
      (the specified number of events between samples has occurred), the even
      processors are configured to handle the performance counter interrupts
      for their node.  The virtual counter routine is called via a kernel
      timer after the virtual sample time.  The routine stops the counters,
      saves the current counts, loads the last counts for the other virtual
      CPU on the node, sets interrupts to be handled by the other virtual CPU
      and restarts the counters, the virtual timer routine is scheduled to run
      again.  The virtual sample time is kept relatively small to make sure
      sampling occurs on both CPUs on the node with a relatively small
      granularity.  Whenever the counters overflow, the performance counter
      interrupt is called to collect the PC for the CPU where data is being
      collected.
      
      The oprofile driver relies on a firmware RTAS call to setup the debug bus
      to route the desired signals to the performance counter hardware to be
      counted.  The RTAS call must set the routing registers appropriately in
      each of the islands to pass the signals down the debug bus as well as
      routing the signals from a particular island onto the bus.  There is a
      second firmware RTAS call to reset the debug bus to the non pass thru
      state when the counters are not in use.
      Signed-off-by: NCarl Love <carll@us.ibm.com>
      Signed-off-by: NMaynard Johnson <mpjohn@us.ibm.com>
      Signed-off-by: NArnd Bergmann <arnd.bergmann@de.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      18f2190d
  28. 25 10月, 2006 4 次提交
    • B
      [POWERPC] Cell timebase bug workaround · 859deea9
      Benjamin Herrenschmidt 提交于
      The Cell CPU timebase has an erratum. When reading the entire 64 bits
      of the timebase with one mftb instruction, there is a handful of cycles
      window during which one might read a value with the low order 32 bits
      already reset to 0x00000000 but the high order bits not yet incremeted
      by one. This fixes it by reading the timebase again until the low order
      32 bits is no longer 0. That might introduce occasional latencies if
      hitting mftb just at the wrong time, but no more than 70ns on a cell
      blade, and that was considered acceptable.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      859deea9
    • B
      [POWERPC] Support feature fixups in vdso's · 0909c8c2
      Benjamin Herrenschmidt 提交于
      This patch reworks the feature fixup mecanism so vdso's can be fixed up.
      The main issue was that the construct:
      
              .long   label  (or .llong on 64 bits)
      
      will not work in the case of a shared library like the vdso. It will
      generate an empty placeholder in the fixup table along with a reloc,
      which is not something we can deal with in the vdso.
      
      The idea here (thanks Alan Modra !) is to instead use something like:
      
      1:
              .long   label - 1b
      
      That is, the feature fixup tables no longer contain addresses of bits of
      code to patch, but offsets of such code from the fixup table entry
      itself. That is properly resolved by ld when building the .so's. I've
      modified the fixup mecanism generically to use that method for the rest
      of the kernel as well.
      
      Another trick is that the 32 bits vDSO included in the 64 bits kernel
      need to have a table in the 64 bits format. However, gas does not
      support 32 bits code with a statement of the form:
      
              .llong  label - 1b  (Or even just .llong label)
      
      That is, it cannot emit the right fixup/relocation for the linker to use
      to assign a 32 bits address to an .llong field. Thus, in the specific
      case of the 32 bits vdso built as part of the 64 bits kernel, we are
      using a modified macro that generates:
      
              .long   0xffffffff
              .llong  label - 1b
      
      Note that is assumes that the value is negative which is enforced by
      the .lds (those offsets are always negative as the .text is always
      before the fixup table and gas doesn't support emiting the reloc the
      other way around).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0909c8c2
    • B
      [POWERPC] Support nested cpu feature sections · 7aeb7324
      Benjamin Herrenschmidt 提交于
      This patch adds some macros that can be used with an explicit label in
      order to nest cpu features. This should be used very careful but is
      necessary for the upcoming cell TB fixup.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      7aeb7324
    • B
      [POWERPC] Consolidate feature fixup code · 42c4aaad
      Benjamin Herrenschmidt 提交于
      There are currently two versions of the functions for applying the
      feature fixups, one for CPU features and one for firmware features. In
      addition, they are both in assembly and with separate implementations
      for 32 and 64 bits. identify_cpu() is also implemented in assembly and
      separately for 32 and 64 bits.
      
      This patch replaces them with a pair of C functions. The call sites are
      slightly moved on ppc64 as well to be called from C instead of from
      assembly, though it's a very small change, and thus shouldn't cause any
      problem.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      42c4aaad
  29. 13 9月, 2006 1 次提交