1. 10 7月, 2017 1 次提交
  2. 05 4月, 2017 1 次提交
    • O
      powerpc/64: Fix flush_(d|i)cache_range() called from modules · 8f5f525d
      Oliver O'Halloran 提交于
      When the kernel is compiled to use 64bit ABIv2 the _GLOBAL() macro does
      not include a global entry point. A function's global entry point is
      used when the function is called from a different TOC context and in the
      kernel this typically means a call from a module into the vmlinux (or
      vice-versa).
      
      There are a few exported asm functions declared with _GLOBAL() and
      calling them from a module will likely crash the kernel since any TOC
      relative load will yield garbage.
      
      flush_icache_range() and flush_dcache_range() are both exported to
      modules, and use the TOC, so must use _GLOBAL_TOC().
      
      Fixes: 721aeaa9 ("powerpc: Build little endian ppc64 kernel with ABIv2")
      Cc: stable@vger.kernel.org # v3.16+
      Signed-off-by: NOliver O'Halloran <oohall@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      8f5f525d
  3. 06 2月, 2017 1 次提交
  4. 30 11月, 2016 1 次提交
  5. 23 9月, 2016 2 次提交
  6. 19 9月, 2016 1 次提交
  7. 08 8月, 2016 1 次提交
  8. 21 7月, 2016 1 次提交
  9. 14 6月, 2016 1 次提交
    • M
      powerpc: Define and use PPC64_ELF_ABI_v2/v1 · f55d9665
      Michael Ellerman 提交于
      We're approaching 20 locations where we need to check for ELF ABI v2.
      That's fine, except the logic is a bit awkward, because we have to check
      that _CALL_ELF is defined and then what its value is.
      
      So check it once in asm/types.h and define PPC64_ELF_ABI_v2 when ELF ABI
      v2 is detected.
      
      We also have a few places where what we're really trying to check is
      that we are using the 64-bit v1 ABI, ie. function descriptors. So also
      add a #define for that, which simplifies several checks.
      Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f55d9665
  10. 21 1月, 2016 1 次提交
    • A
      powerpc: Simplify module TOC handling · c153693d
      Alan Modra 提交于
      PowerPC64 uses the symbol .TOC. much as other targets use
      _GLOBAL_OFFSET_TABLE_. It identifies the value of the GOT pointer (or in
      powerpc parlance, the TOC pointer). Global offset tables are generally
      local to an executable or shared library, or in the kernel, module. Thus
      it does not make sense for a module to resolve a relocation against
      .TOC. to the kernel's .TOC. value. A module has its own .TOC., and
      indeed the powerpc64 module relocation processing ignores the kernel
      value of .TOC. and instead calculates a module-local value.
      
      This patch removes code involved in exporting the kernel .TOC., tweaks
      modpost to ignore an undefined .TOC., and the module loader to twiddle
      the section symbol so that .TOC. isn't seen as undefined.
      
      Note that if the kernel was compiled with -msingle-pic-base then ELFv2
      would not have function global entry code setting up r2. In that case
      the module call stubs would need to be modified to set up r2 using the
      kernel .TOC. value, requiring some of this code to be reinstated.
      
      mpe: Furthermore a change in binutils master (not yet released) causes
      the current way we handle the TOC to no longer work when building with
      MODVERSIONS=y and RELOCATABLE=n. The symptom is that modules can not be
      loaded due to there being no version found for TOC.
      
      Cc: stable@vger.kernel.org # 3.16+
      Signed-off-by: NAlan Modra <amodra@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      c153693d
  11. 28 10月, 2015 3 次提交
  12. 20 8月, 2015 1 次提交
  13. 23 4月, 2014 4 次提交
  14. 10 12月, 2013 1 次提交
  15. 02 12月, 2013 1 次提交
  16. 25 9月, 2013 1 次提交
  17. 14 8月, 2013 4 次提交
  18. 14 5月, 2013 1 次提交
  19. 01 10月, 2012 1 次提交
  20. 10 7月, 2012 3 次提交
  21. 29 6月, 2011 1 次提交
  22. 19 5月, 2011 1 次提交
    • M
      powerpc/kexec: Fix memory corruption from unallocated slaves · 3d2cea73
      Milton Miller 提交于
      Commit 1fc711f7 (powerpc/kexec: Fix race
      in kexec shutdown) moved the write to signal the cpu had exited the kernel
      from before the transition to real mode in kexec_smp_wait to kexec_wait.
      
      Unfornately it missed that kexec_wait is used both by cpus leaving the
      kernel and by secondary slave cpus that were not allocated a paca for
      what ever reason -- they could be beyond nr_cpus or not described in
      the current device tree for whatever reason (for example, kexec-load
      was not refreshed after a cpu hotplug operation).  Cpus coming through
      that path they will write to paca[NR_CPUS] which is beyond the space
      allocated for the paca data and overwrite memory not allocated to pacas
      but very likely still real mode accessable).
      
      Move the write back to kexec_smp_wait, which is used only by cpus that
      found their paca, but after the transition to real mode.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Cc: <stable@kernel.org> # (1fc711f7 was backported to 2.6.32)
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3d2cea73
  23. 29 11月, 2010 1 次提交
  24. 15 6月, 2010 1 次提交
  25. 21 5月, 2010 1 次提交
    • M
      powerpc/kexec: Fix race in kexec shutdown · 1fc711f7
      Michael Neuling 提交于
      In kexec_prepare_cpus, the primary CPU IPIs the secondary CPUs to
      kexec_smp_down().  kexec_smp_down() calls kexec_smp_wait() which sets
      the hw_cpu_id() to -1.  The primary does this while leaving IRQs on
      which means the primary can take a timer interrupt which can lead to
      the IPIing one of the secondary CPUs (say, for a scheduler re-balance)
      but since the secondary CPU now has a hw_cpu_id = -1, we IPI CPU
      -1... Kaboom!
      
      We are hitting this case regularly on POWER7 machines.
      
      There is also a second race, where the primary will tear down the MMU
      mappings before knowing the secondaries have entered real mode.
      
      Also, the secondaries are clearing out any pending IPIs before
      guaranteeing that no more will be received.
      
      This changes kexec_prepare_cpus() so that we turn off IRQs in the
      primary CPU much earlier.  It adds a paca flag to say that the
      secondaries have entered the kexec_smp_down() IPI and turned off IRQs,
      rather than overloading hw_cpu_id with -1.  This new paca flag is
      again used to in indicate when the secondaries has entered real mode.
      
      It also ensures that all CPUs have their IRQs off before we clear out
      any pending IPI requests (in kexec_cpu_down()) to ensure there are no
      trailing IPIs left unacknowledged.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1fc711f7
  26. 09 6月, 2009 1 次提交
  27. 07 4月, 2009 1 次提交
    • M
      powerpc: Disable VSX or current process in giveup_fpu/altivec · 7e875e9d
      Michael Neuling 提交于
      When we call giveup_fpu, we need to need to turn off VSX for the
      current process.  If we don't, on return to userspace it may execute a
      VSX instruction before the next FP instruction, and not have its
      register state refreshed correctly from the thread_struct.  Ditto for
      altivec.
      
      This caused a bug where an unaligned lfs or stfs results in
      fix_alignment calling giveup_fpu so it can use the FPRs (in order to
      do a single <-> double conversion), and then returning to userspace
      with FP off but VSX on.  Then if a VSX instruction is executed, before
      another FP instruction, it will proceed without another exception and
      hence have the incorrect register state for VSX registers 0-31.
      
         lfs unaligned   <- alignment exception turns FP off but leaves VSX on
      
         VSX instruction <- no exception since VSX on, hence we get the
                            wrong VSX register values for VSX registers 0-31,
                            which overlap the FPRs.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      7e875e9d
  28. 31 10月, 2008 1 次提交
    • M
      powerpc: Kexec exit should not use magic numbers · 1767c8f3
      Milton Miller 提交于
      Commit 54622f10 ("powerpc: Support for
      relocatable kdump kernel") added a magic flag value in a register to
      tell purgatory that it should be a panic kernel.  This part is wrong
      and is reverted by this commit.
      
      The kernel gets a list of memory blocks and a entry point from user space.
      Its job is to copy the blocks into place and then branch to the designated
      entry point (after turning "off" the mmu).
      
      The user space tool inserts a trampoline, called purgatory, that runs
      before the user supplied code.   Its job is to establish the entry
      environment for the new kernel or other application based on the contents
      of memory.  The purgatory code is compiled and embedded in the tool,
      where it is later patched using the elf symbol table using elf symbols.
      
      Since the tool knows it is creating a purgatory that will run after a
      kernel crash, it should just patch purgatory (or the kernel directly)
      if something needs to happen.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1767c8f3
  29. 22 10月, 2008 1 次提交
    • M
      powerpc: Support for relocatable kdump kernel · 54622f10
      Mohan Kumar M 提交于
      This adds relocatable kernel support for kdump. With this one can
      use the same regular kernel to capture the kdump. A signature (0xfeed1234)
      is passed in r6 from panic code to the next kernel through kexec_sequence
      and purgatory code. The signature is used to differentiate between
      kdump kernel and non-kdump kernels.
      
      The purgatory code compares the signature and sets the __kdump_flag in
      head_64.S.  During the boot up, kernel code checks __kdump_flag and if it
      is set, the kernel will behave as relocatable kdump kernel. This kernel
      will boot at the address where it was loaded by kexec-tools ie. at the
      address reserved through crashkernel boot parameter.
      
      CONFIG_CRASH_DUMP depends on CONFIG_RELOCATABLE option to build kdump
      kernel as relocatable. So the same kernel can be used as production and
      kdump kernel.
      
      This patch incorporates the changes suggested by Paul Mackerras to avoid
      GOT use and to avoid two copies of the code.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMohan Kumar M <mohan@in.ibm.com>
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      54622f10