1. 30 4月, 2013 7 次提交
  2. 26 4月, 2013 16 次提交
    • A
      powerpc/perf: Enable branch stack sampling framework · 3925f46b
      Anshuman Khandual 提交于
      Provides basic enablement for perf branch stack sampling framework on
      POWER8 processor based platforms. Adds new BHRB related elements into
      cpu_hw_event structure to represent current BHRB config, BHRB filter
      configuration, manage context and to hold output BHRB buffer during
      PMU interrupt before passing to the user space. This also enables
      processing of BHRB data and converts them into generic perf branch
      stack data format.
      Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3925f46b
    • A
      powerpc/perf: Add new BHRB related generic functions, data and flags · 5afc9b52
      Anshuman Khandual 提交于
      This patch adds couple of generic functions to power_pmu structure
      which would configure the BHRB and it's filters. It also adds
      representation of the number of BHRB entries present on the PMU.
      A new PMU flag PPMU_BHRB would indicate presence of BHRB feature.
      Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5afc9b52
    • A
      powerpc/perf: Add new BHRB related instructions for POWER8 · 95213959
      Anshuman Khandual 提交于
      This patch adds new POWER8 instruction encoding for reading
      and clearing Branch History Rolling Buffer entries. The new
      instruction 'mfbhrbe' (move from branch history rolling buffer
      entry) is used to read BHRB buffer entries and instruction
      'clrbhrb' (clear branch history rolling buffer) is used to
      clear the entire buffer. The instruction 'clrbhrb' has straight
      forward encoding. But the instruction encoding format for
      reading the BHRB entries is like 'mfbhrbe RT, BHRBE' where it
      takes two arguments, i.e the index for the BHRB buffer entry to
      read and a general purpose register to put the value which was
      read from the buffer entry.
      Signed-off-by: NAnshuman Khandual <khandual@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      95213959
    • M
      powerpc/perf: Add support for SIER · 8f61aa32
      Michael Ellerman 提交于
      On power8 we have a new SIER (Sampled Instruction Event Register), which
      captures information about instructions when we have random sampling
      enabled.
      
      Add support for loading the SIER into pt_regs, overloading regs->dar.
      Also set the new NO_SIPR flag in regs->result if we don't have SIPR.
      
      Update regs_sihv/sipr() to look for SIPR/SIHV in SIER.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8f61aa32
    • M
      powerpc/perf: Add an explict flag indicating presence of SLOT field · 7a786832
      Michael Ellerman 提交于
      In perf_ip_adjust() we potentially use the MMCRA[SLOT] field to adjust
      the reported IP of a sampled instruction.
      
      Currently the logic is written so that if the backend does NOT have
      the PPMU_ALT_SIPR flag set then we assume MMCRA[SLOT] exists.
      
      However on power8 we do not want to set ALT_SIPR (it's in a third
      location), and we also do not have MMCRA[SLOT].
      
      So add a new flag which only indicates whether MMCRA[SLOT] exists.
      
      Naively we'd set it on everything except power6/7, because they set
      ALT_SIPR, and we've reversed the polarity of the flag. But it's more
      complicated than that.
      
      mpc7450 is 32-bit, and uses its own version of perf_ip_adjust()
      which doesn't use MMCRA[SLOT], so it doesn't need the new flag set and
      the behaviour is unchanged.
      
      PPC970 (and I assume power4) don't have MMCRA[SLOT], so shouldn't have
      the new flag set. This is a behaviour change on those cpus, though we
      were probably getting lucky and the bits in question were 0.
      
      power5 and power5+ set the new flag, behaviour unchanged.
      
      power6 & power7 do not set the new flag, behaviour unchanged.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7a786832
    • M
      powerpc: Initialise PMU related regs on Power8 · 240686c1
      Michael Ellerman 提交于
      For both HV and guest kernels, intialise PMU regs to something sane.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      240686c1
    • G
      powerpc/powernv: Patch MSI EOI handler on P8 · 137436c9
      Gavin Shan 提交于
      The EOI handler of MSI/MSI-X interrupts for P8 (PHB3) need additional
      steps to handle the P/Q bits in IVE before EOIing the corresponding
      interrupt. The patch changes the EOI handler to cover that. we have
      individual IRQ chip in each PHB instance. During the MSI IRQ setup
      time, the IRQ chip is copied over from the original one for that IRQ,
      and the EOI handler is patched with the one that will handle the P/Q
      bits (As Ben suggested).
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      137436c9
    • P
      powerpc: Fix "attempt to move .org backwards" error · a485c709
      Paul Mackerras 提交于
      Building a 64-bit powerpc kernel with PR KVM enabled currently gives
      this error:
      
        AS      arch/powerpc/kernel/head_64.o
      arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
      arch/powerpc/kernel/exceptions-64s.S:258: Error: attempt to move .org backwards
      make[2]: *** [arch/powerpc/kernel/head_64.o] Error 1
      
      This happens because the MASKABLE_EXCEPTION_PSERIES macro turns into
      33 instructions, but we only have space for 32 at the decrementer
      interrupt vector (from 0x900 to 0x980).
      
      In the code generated by the MASKABLE_EXCEPTION_PSERIES macro, we
      currently have two instances of the HMT_MEDIUM macro, which has the
      effect of setting the SMT thread priority to medium.  One is the
      first instruction, and is overwritten by a no-op on processors where
      we save the PPR (processor priority register), that is, POWER7 or
      later.  The other is after we have saved the PPR.
      
      In order to reduce the code at 0x900 by one instruction, we omit the
      first HMT_MEDIUM.  On processors without SMT this will have no effect
      since HMT_MEDIUM is a no-op there.  On POWER5 and RS64 machines this
      will mean that the first few instructions take a little longer in the
      case where a decrementer interrupt occurs when the hardware thread is
      running at low SMT priority.  On POWER6 and later machines, the
      hardware automatically boosts the thread priority when a decrementer
      interrupt is taken if the thread priority was below medium, so this
      change won't make any difference.
      
      The alternative would be to branch out of line after saving the CFAR.
      However, that would incur an extra overhead on all processors, whereas
      the approach adopted here only adds overhead on older threaded processors.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a485c709
    • N
      powerpc/pseries: Add /proc interface to control topology updates · e04fa612
      Nathan Fontenot 提交于
      There are instances in which we do not want topology updates to occur.
      In order to allow this a /proc interface (/proc/powerpc/topology_updates)
      is introduced so that topology updates can be enabled and disabled.
      
      This patch also adds a prrn_is_enabled() call so that PRRN events are
      handled in the kernel only if topology updating is enabled.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e04fa612
    • J
      powerpc/pseries: Update CPU maps when device tree is updated · 5d88aa85
      Jesse Larrew 提交于
      Platform events such as partition migration or the new PRRN firmware
      feature can cause the NUMA characteristics of a CPU to change, and these
      changes will be reflected in the device tree nodes for the affected
      CPUs.
      
      This patch registers a handler for Open Firmware device tree updates
      and reconfigures the CPU and node maps whenever the associativity
      changes. Currently, this is accomplished by marking the affected CPUs in
      the cpu_associativity_changes_mask and allowing
      arch_update_cpu_topology() to retrieve the new associativity information
      using hcall_vphn().
      
      Protecting the NUMA cpu maps from concurrent access during an update
      operation will be addressed in a subsequent patch in this series.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5d88aa85
    • N
      powerpc/pseries: Update firmware_has_feature() to check architecture vector 5 bits · f0ff7eb4
      Nathan Fontenot 提交于
      The firmware_has_feature() function makes it easy to check for supported
      features of the hypervisor. This patch extends the capability of
      firmware_has_feature() to include checking for specified bits
      in vector 5 of the architecture vector as reported in the device tree.
      
      As part of this the #defines used for the architecture vector are re-defined
      such that each option has the index into vector 5 and the feature bit encoded
      into it. This makes checking for architecture bits when initiating data
      for firmware_has_feature much easier.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f0ff7eb4
    • N
      powerpc/pseries: Use ARRAY_SIZE to iterate over firmware_features_table array · 43c0ea60
      Nathan Fontenot 提交于
      When iterating over the entries in firmware_features_table we only need
      to go over the actual number of entries in the array instead of declaring
      it to be bigger and checking to make sure there is a valid entry in every
      slot.
      
      This patch removes the FIRMWARE_MAX_FEATURES #define and replaces the
      array looping with the use of ARRAY_SIZE().
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      43c0ea60
    • N
      powerpc/pseries: Move architecture vector definitions to prom.h · 530b5e14
      Nathan Fontenot 提交于
      As part of handling of PRRN events we need to check vector 5 of the
      architecture vector bits reported in the device tree to ensure PRRN event
      handling is enabled. To do this firmware_has_feature() is updated (in a
      subsequent patch) to make this check vector 5 bits. To avoid having to
      re-define bits in the architecture vector the bit definitions are moved
      to prom.h.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      530b5e14
    • J
      powerpc/pseries: Add PRRN RTAS event handler · 49c68a85
      Jesse Larrew 提交于
      A PRRN event is signaled via the RTAS event-scan mechanism, which
      returns a Hot Plug Event message "fixed part" indicating "Platform
      Resource Reassignment". In response to the Hot Plug Event message,
      we must call ibm,update-nodes to determine which resources were
      reassigned and then ibm,update-properties to obtain the new affinity
      information about those resources.
      
      The PRRN event-scan RTAS message contains only the "fixed part" with
      the "Type" field set to the value 160 and no Extended Event Log. The
      four-byte Extended Event Log Length field is re-purposed (since no
      Extended Event Log message is included) to pass the "scope" parameter
      that causes the ibm,update-nodes to return the nodes affected by the
      specific resource reassignment.
      
      This patch adds a handler for RTAS events. The function
      pseries_devicetree_update() (from mobility.c) is used to make the
      ibm,update-nodes/ibm,update-properties RTAS calls. Updating the NUMA maps
      (handled by a subsequent patch) will require significant processing,
      so pseries_devicetree_update() is called from an asynchronous workqueue
      to allow event processing to continue.
      
      PRRN RTAS events on pseries systems are rare events that have to be
      initiated from the HMC console for the system by an IBM tech. This allows
      us to assume that these events are widely spaced. Additionally, all work
      on the queue is flushed before handling any new work to ensure we only have
      one event in flight being handled at a time.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      49c68a85
    • N
      powerpc/pseries: Expose pseries devicetree_update() · 762ec157
      Nathan Fontenot 提交于
      Newer firmware on Power systems can transparently reassign platform resources
      (CPU and Memory) in use. For instance, if a processor or memory unit is
      predicted to fail, the platform may transparently move the processing to an
      equivalent unused processor or the memory state to an equivalent unused
      memory unit. However, reassigning resources across NUMA boundaries may alter
      the performance of the partition. When such reassignment is necessary, the
      Platform Resource Reassignment Notification (PRRN) option provides a
      mechanism to inform the Linux kernel of changes to the NUMA affinity of
      its platform resources.
      
      When rtasd receives a PRRN event, it needs to make a series of RTAS
      calls (ibm,update-nodes and ibm,update-properties) to retrieve the
      updated device tree information. These calls are already handled in the
      pseries_devicetree_update() routine used in partition migration.
      
      This patch exposes pseries_devicetree_update() to make it accessible
      to other pseries routines, this patch also updates pseries_devicetree_update()
      to take a 32-bit scope parameter. The scope value, which was previously hard
      coded to 1 for partition migration, is used for the RTAS calls
      ibm,update-nodes/properties to update the device tree.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      762ec157
    • M
      powerpc: Add HWCAP2 aux entry · 2171364d
      Michael Neuling 提交于
      We are currently out of free bits in AT_HWCAP. With POWER8, we have
      several hardware features that we need to advertise.
      
      Tested on POWER and x86.
      Signed-off-by: NMichael Neuling <michael@neuling.org>
      Signed-off-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2171364d
  3. 18 4月, 2013 8 次提交
  4. 10 4月, 2013 2 次提交
  5. 17 3月, 2013 3 次提交
  6. 13 3月, 2013 1 次提交
  7. 05 3月, 2013 3 次提交