1. 27 8月, 2013 2 次提交
    • P
      powerpc: Work around gcc miscompilation of __pa() on 64-bit · bdbc29c1
      Paul Mackerras 提交于
      On 64-bit, __pa(&static_var) gets miscompiled by recent versions of
      gcc as something like:
      
              addis 3,2,.LANCHOR1+4611686018427387904@toc@ha
              addi 3,3,.LANCHOR1+4611686018427387904@toc@l
      
      This ends up effectively ignoring the offset, since its bottom 32 bits
      are zero, and means that the result of __pa() still has 0xC in the top
      nibble.  This happens with gcc 4.8.1, at least.
      
      To work around this, for 64-bit we make __pa() use an AND operator,
      and for symmetry, we make __va() use an OR operator.  Using an AND
      operator rather than a subtraction ends up with slightly shorter code
      since it can be done with a single clrldi instruction, whereas it
      takes three instructions to form the constant (-PAGE_OFFSET) and add
      it on.  (Note that MEMORY_START is always 0 on 64-bit.)
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bdbc29c1
    • B
      powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor · f5f6cbb6
      Benjamin Herrenschmidt 提交于
      /proc/powerpc/lparcfg is an ancient facility (though still actively used)
      which allows access to some informations relative to the partition when
      running underneath a PAPR compliant hypervisor.
      
      It makes no sense on non-pseries machines. However, currently, not only
      can it be created on these if the kernel has pseries support, but accessing
      it on such a machine will crash due to trying to do hypervisor calls.
      
      In fact, it should also not do HV calls on older pseries that didn't have
      an hypervisor either.
      
      Finally, it has the plumbing to be a module but is a "bool" Kconfig option.
      
      This fixes the whole lot by turning it into a machine_device_initcall
      that is only created on pseries, and adding the necessary hypervisor
      check before calling the H_GET_EM_PARMS hypercall
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f5f6cbb6
  2. 23 8月, 2013 2 次提交
  3. 21 8月, 2013 2 次提交
    • S
      of: move of_get_cpu_node implementation to DT core library · 183912d3
      Sudeep KarkadaNagesha 提交于
      This patch moves the generalized implementation of of_get_cpu_node from
      PowerPC to DT core library, thereby adding support for retrieving cpu
      node for a given logical cpu index on any architecture.
      
      The CPU subsystem can now use this function to assign of_node in the
      cpu device while registering CPUs.
      
      It is recommended to use these helper function only in pre-SMP/early
      initialisation stages to retrieve CPU device node pointers in logical
      ordering. Once the cpu devices are registered, it can be retrieved easily
      from cpu device of_node which avoids unnecessary parsing and matching.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
      183912d3
    • S
      powerpc: refactor of_get_cpu_node to support other architectures · 819d5965
      Sudeep KarkadaNagesha 提交于
      Currently different drivers requiring to access cpu device node are
      parsing the device tree themselves. Since the ordering in the DT need
      not match the logical cpu ordering, the parsing logic needs to consider
      that. However, this has resulted in lots of code duplication and in some
      cases even incorrect logic.
      
      It's better to consolidate them by adding support for getting cpu
      device node for a given logical cpu index in DT core library. However
      logical to physical index mapping can be architecture specific.
      
      PowerPC has it's own implementation to get the cpu node for a given
      logical index.
      
      This patch refactors the current implementation of of_get_cpu_node.
      This in preparation to move the implementation to DT core library.
      It separates out the logical to physical mapping so that a default
      matching of the physical id to the logical cpu index can be added
      when moved to common code. Architecture specific code can override it.
      
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
      819d5965
  4. 09 8月, 2013 11 次提交
  5. 01 8月, 2013 3 次提交
    • R
      powerpc: VPHN topology change updates all siblings · 3be7db6a
      Robert Jennings 提交于
      When an associativity level change is found for one thread, the
      siblings threads need to be updated as well.  This is done today
      for PRRN in stage_topology_update() but is missing for VPHN in
      update_cpu_associativity_changes_mask().  This patch will correctly
      update all thread siblings during a topology change.
      
      Without this patch a topology update can result in a CPU in
      init_sched_groups_power() getting stuck indefinitely in a loop.
      
      This loop is built in build_sched_groups(). As a result of the thread
      moving to a node separate from its siblings the struct sched_group will
      have its next pointer set to point to itself rather than the sched_group
      struct of the next thread.  This happens because we have a domain without
      the SD_OVERLAP flag, which is correct, and a topology that doesn't conform
      with reality (threads on the same core assigned to different numa nodes).
      When this list is traversed by init_sched_groups_power() it will reach
      the thread's sched_group structure and loop indefinitely; the cpu will
      be stuck at this point.
      
      The bug was exposed when VPHN was enabled in commit b7abef04 (v3.9).
      
      Cc: <stable@vger.kernel.org> [v3.9+]
      Reported-by: NJan Stancek <jstancek@redhat.com>
      Signed-off-by: NRobert Jennings <rcj@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3be7db6a
    • M
      powerpc/perf: Export PERF_EVENT_CONFIG_EBB_SHIFT to userspace · 8d7c55d0
      Michael Ellerman 提交于
      We use bit 63 of the event code for userspace to request that the event
      be counted using EBB (Event Based Branches). Export this value, making
      it part of the API - though only on processors that support EBB.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8d7c55d0
    • M
      powerpc: Rename PMU interrupts from CNT to PMI · e8e813ed
      Michael Ellerman 提交于
      Back in commit 89713ed1 "Add timer, performance monitor and machine check
      counts to /proc/interrupts" we added a count of PMU interrupts to the
      output of /proc/interrupts.
      
      At the time we named them "CNT" to match x86.
      
      However in commit 89ccf465 "Rename 'performance counter interrupt'", the
      x86 guys renamed theirs from "CNT" to "PMI".
      
      Arguably changing the name could break someone's script, but I think the
      chance of that is minimal, and it's preferable to have a name that 1) is
      somewhat meaningful, and 2) matches x86.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e8e813ed
  6. 26 7月, 2013 1 次提交
  7. 24 7月, 2013 19 次提交