1. 28 May, 2014 17 commits
    • Paul Burton's avatar
      MIPS: smp-cps: hotplug support · 1d8f1f5a
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      1d8f1f5a
    • Paul Burton's avatar
      MIPS: pm-cps: add PM state entry code for CPS systems · 3179d37e
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      3179d37e
    • Paul Burton's avatar
      MIPS: smp-cps: use CPC core-other locking · dd9233d0
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      dd9233d0
    • Paul Burton's avatar
      MIPS: smp-cps: flush cache after patching mips_cps_core_entry · 0f4d3d11
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      0f4d3d11
    • Paul Burton's avatar
      MIPS: smp-cps: function to determine whether CPS SMP is in use · 68c1232f
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      68c1232f
    • Paul Burton's avatar
      MIPS: smp-cps: rework core/VPE initialisation · 245a7868
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      245a7868
    • Paul Burton's avatar
      MIPS: uasm: add MT ASE yield instruction · d674dd14
      Paul Burton authored
      This patch allows use of the MT ASE yield instruction from uasm. It will
      be used by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      d674dd14
    • Paul Burton's avatar
      MIPS: uasm: add wait instruction · 53ed1389
      Paul Burton authored
      This patch allows use of the wait instruction from uasm. It will be used
      by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      53ed1389
    • Paul Burton's avatar
      MIPS: uasm: add sync instruction · 729ff561
      Paul Burton authored
      This patch allows use of the sync instruction from uasm. It will be used
      by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      729ff561
    • Paul Burton's avatar
      MIPS: uasm: add jalr instruction · 49e9529b
      Paul Burton authored
      This patch allows use of the jalr instruction from uasm. It will be used
      by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      49e9529b
    • Paul Burton's avatar
      MIPS: uasm: add a label variant of beq · 8dee5901
      Paul Burton authored
      This patch allows for use of the beq instruction with labels from uasm,
      much as bne & others already do. It will be used by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      8dee5901
    • Paul Burton's avatar
      MIPS: inst.h: define microMIPS wait op · f263839a
      Paul Burton authored
      The opcode for the wait instruction within POOL32AXf was missing. This
      patch adds it for use by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      f263839a
    • Paul Burton's avatar
      MIPS: inst.h: define microMIPS sync op · 7ed82ad1
      Paul Burton authored
      The opcode for the sync instruction within POOL32AXf was missing. This
      patch adds it for use by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      7ed82ad1
    • Paul Burton's avatar
      MIPS: inst.h: define MT yield op · 6f5bb424
      Paul Burton authored
      The opcode for the MT ASE yield instruction within the spec3 group was
      missing. This patch adds it for use by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      6f5bb424
    • Paul Burton's avatar
      MIPS: inst.h: define COP0 wait op · b0a3eae2
      Paul Burton authored
      The func field for the wait instruction was missing from inst.h - this
      patch adds it.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      b0a3eae2
    • Paul Burton's avatar
      MIPS: MT: define write_c0_tchalt macro · 27476f3b
      Paul Burton authored
      Define a macro to write to the current TCs TCHalt register. This will be
      used by a subsequent patch.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      27476f3b
    • Paul Burton's avatar
      MIPS: add kmap_noncoherent to wire a cached non-coherent TLB entry · e2a9e5ad
      Paul Burton authored
      This is identical to kmap_coherent apart from the cache coherency
      attribute used for the TLB entry, so kmap_coherent is abstracted to
      kmap_prot which is then called for both kmap_coherent &
      kmap_noncoherent. This will be used by a subsequent patch.
      Suggested-by: default avatarLeonid Yegoshin <leonid.yegoshin@imgtec.com>
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      e2a9e5ad
  2. 02 May, 2014 13 commits
  3. 24 Apr, 2014 1 commit
  4. 20 Apr, 2014 5 commits
  5. 19 Apr, 2014 4 commits
    • Adrien BAK's avatar
      perf tools: Improve error reporting · ffa91880
      Adrien BAK authored
      In the current version, when using perf record, if something goes
      wrong in tools/perf/builtin-record.c:375
        session = perf_session__new(file, false, NULL);
      
      The error message:
      "Not enough memory for reading per file header"
      
      is issued. This error message seems to be outdated and is not very
      helpful. This patch proposes to replace this error message by
      "Perf session creation failed"
      
      I believe this issue has been brought to lkml:
      https://lkml.org/lkml/2014/2/24/458
      although this patch only tackles a (small) part of the issue.
      
      Additionnaly, this patch improves error reporting in
      tools/perf/util/data.c open_file_write.
      
      Currently, if the call to open fails, the user is unaware of it.
      This patch logs the error, before returning the error code to
      the caller.
      Reported-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarAdrien BAK <adrien.bak@metascale.org>
      Link: http://lkml.kernel.org/r/1397786443.3093.4.camel@beast
      [ Reorganize the changelog into paragraphs ]
      [ Added empty line after fd declaration in open_file_write ]
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      ffa91880
    • Vladimir Nikulichev's avatar
      perf tools: Adjust symbols in VDSO · 922d0e4d
      Vladimir Nikulichev authored
      pert-report doesn't resolve function names in VDSO:
      
      $ perf report --stdio -g flat,0.0,15,callee --sort pid
      ...
                  8.76%
                     0x7fff6b1fe861
                     __gettimeofday
                     ACE_OS::gettimeofday()
      ...
      
      In this case symbol values should be adjusted the same way as for executables,
      relocatable objects and prelinked libraries.
      
      After fix:
      
      $ perf report --stdio -g flat,0.0,15,callee --sort pid
      ...
                  8.76%
                     __vdso_gettimeofday
                     __gettimeofday
                     ACE_OS::gettimeofday()
      Signed-off-by: default avatarVladimir Nikulichev <nvs@tbricks.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/969812.163009436-sendEmail@nvsSigned-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      922d0e4d
    • Alexander Yarygin's avatar
      perf kvm: Fix 'Min time' counting in report command · acb61fc8
      Alexander Yarygin authored
      Every event in the perf-kvm has a 'stats' structure, which contains
      max/min/average/etc times of handling this event.
      The problem is that the 'perf-kvm stat report' command always shows
      that 'min time' is 0us for every event. Example:
      
       # perf kvm stat report
      
       Analyze events for all VCPUs:
      
          VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
        [..]
        0xB2 MSCH         12     0.07%     0.00%        0us        8us 7.31us ( +-   2.11% )
        0xB2 CHSC         12     0.07%     0.00%        0us       18us 9.39us ( +-   9.49% )
        0xB2 STPX          8     0.05%     0.00%        0us        2us 1.88us ( +-   7.18% )
        0xB2 STSI          7     0.04%     0.00%        0us       44us 16.49us ( +-  38.20% )
        [..]
      
      This happens because the 'stats' structure is not initialized and
      stats->min equals to 0. Lets initialize the structure for every
      event after its allocation using init_stats() function. This initializes
      stats->min to -1 and makes 'Min time' statistics counting work:
      
       # perf kvm stat report
      
       Analyze events for all VCPUs:
      
          VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
        [..]
        0xB2 MSCH         12     0.07%     0.00%        6us        8us 7.31us ( +-   2.11% )
        0xB2 CHSC         12     0.07%     0.00%        7us       18us 9.39us ( +-   9.49% )
        0xB2 STPX          8     0.05%     0.00%        1us        2us 1.88us ( +-   7.18% )
        0xB2 STSI          7     0.04%     0.00%        1us       44us 16.49us ( +-  38.20% )
        [..]
      Signed-off-by: default avatarAlexander Yarygin <yarygin@linux.vnet.ibm.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
      Link: http://lkml.kernel.org/r/1397053319-2130-3-git-send-email-borntraeger@de.ibm.com
      [ Fixing the perf examples changelog output ]
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      acb61fc8
    • Eric Dumazet's avatar
      coredump: fix va_list corruption · 404ca80e
      Eric Dumazet authored
      A va_list needs to be copied in case it needs to be used twice.
      
      Thanks to Hugh for debugging this issue, leading to various panics.
      
      Tested:
      
        lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
      
      'produce_core' is simply : main() { *(int *)0 = 1;}
      
        lpq84:~# ./produce_core
        Segmentation fault (core dumped)
        lpq84:~# dmesg | tail -1
        [  614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed
      
      Notice the last argument was replaced by a NULL (we were lucky enough to
      not crash, but do not try this on your production machine !)
      
      After fix :
      
        lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
        lpq83:~# ./produce_core
        Segmentation fault
        lpq83:~# dmesg | tail -1
        [  740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed
      
      Fixes: 5fe9d8ca ("coredump: cn_vprintf() has no reason to call vsnprintf() twice")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Diagnosed-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: stable@vger.kernel.org # 3.11+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      404ca80e