1. 16 9月, 2008 12 次提交
    • B
      powerpc: Rename PTE_SIZE to HPTE_SIZE · aaf4a9b0
      Becky Bruce 提交于
      It's the size of the hardware PTE; make that clear in the name.
      Signed-off-by: NBecky Bruce <becky.bruce@freescale.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      aaf4a9b0
    • T
      powerpc: Enforce a non-spe kernel build even on broken compilers · ce400c01
      Thiemo Seufer 提交于
      Those two are required on my fresh gcc 4.3.1.
      Signed-off-by: NThiemo Seufer <ths@linutronix.de>
      Signed-off-by: NSebastian Siewior <bigeasy@linutronix.de>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      ce400c01
    • C
      powerpc: Use sys_pause for 32-bit pause entry point · d6c93adb
      Christoph Hellwig 提交于
      sys32_pause is a useless copy of the generic sys_pause.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      d6c93adb
    • P
      powerpc: Make the 64-bit kernel as a position-independent executable · 549e8152
      Paul Mackerras 提交于
      This implements CONFIG_RELOCATABLE for 64-bit by making the kernel as
      a position-independent executable (PIE) when it is set.  This involves
      processing the dynamic relocations in the image in the early stages of
      booting, even if the kernel is being run at the address it is linked at,
      since the linker does not necessarily fill in words in the image for
      which there are dynamic relocations.  (In fact the linker does fill in
      such words for 64-bit executables, though not for 32-bit executables,
      so in principle we could avoid calling relocate() entirely when we're
      running a 64-bit kernel at the linked address.)
      
      The dynamic relocations are processed by a new function relocate(addr),
      where the addr parameter is the virtual address where the image will be
      run.  In fact we call it twice; once before calling prom_init, and again
      when starting the main kernel.  This means that reloc_offset() returns
      0 in prom_init (since it has been relocated to the address it is running
      at), which necessitated a few adjustments.
      
      This also changes __va and __pa to use an equivalent definition that is
      simpler.  With the relocatable kernel, PAGE_OFFSET and MEMORY_START are
      constants (for 64-bit) whereas PHYSICAL_START is a variable (and
      KERNELBASE ideally should be too, but isn't yet).
      
      With this, relocatable kernels still copy themselves down to physical
      address 0 and run there.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      549e8152
    • P
      powerpc: Use LOAD_REG_IMMEDIATE only for constants on 64-bit · e31aa453
      Paul Mackerras 提交于
      Using LOAD_REG_IMMEDIATE to get the address of kernel symbols
      generates 5 instructions where LOAD_REG_ADDR can do it in one,
      and will generate R_PPC64_ADDR16_* relocations in the output when
      we get to making the kernel as a position-independent executable,
      which we'd rather not have to handle.  This changes various bits
      of assembly code to use LOAD_REG_ADDR when we need to get the
      address of a symbol, or to use suitable position-independent code
      for cases where we can't access the TOC for various reasons, or
      if we're not running at the address we were linked at.
      
      It also cleans up a few minor things; there's no reason to save and
      restore SRR0/1 around RTAS calls, __mmu_off can get the return
      address from LR more conveniently than the caller can supply it in
      R4 (and we already assume elsewhere that EA == RA if the MMU is on
      in early boot), and enable_64b_mode was using 5 instructions where
      2 would do.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e31aa453
    • P
      powerpc: Make it possible to move the interrupt handlers away from the kernel · 1f6a93e4
      Paul Mackerras 提交于
      This changes the way that the exception prologs transfer control to
      the handlers in 64-bit kernels with the aim of making it possible to
      have the prologs separate from the main body of the kernel.  Now,
      instead of computing the address of the handler by taking the top
      32 bits of the paca address (to get the 0xc0000000........ part) and
      ORing in something in the bottom 16 bits, we get the base address of
      the kernel by doing a load from the paca and add an offset.
      
      This also replaces an mfmsr and an ori to compute the MSR value for
      the handler with a load from the paca.  That makes it unnecessary to
      have a separate version of EXCEPTION_PROLOG_PSERIES that forces 64-bit
      mode.
      
      We can no longer use a direct branches in the exception prolog code,
      which means that the SLB miss handlers can't branch directly to
      .slb_miss_realmode any more.  Instead we have to compute the address
      and do an indirect branch.  This is conditional on CONFIG_RELOCATABLE;
      for non-relocatable kernels we use a direct branch as before.  (A later
      change will allow CONFIG_RELOCATABLE to be set on 64-bit powerpc.)
      
      Since the secondary CPUs on pSeries start execution in the first 0x100
      bytes of real memory and then have to get to wherever the kernel is,
      we can't use a direct branch to get there.  Instead this changes
      __secondary_hold_spinloop from a flag to a function pointer.  When it
      is set to a non-NULL value, the secondary CPUs jump to the function
      pointed to by that value.
      
      Finally this eliminates one code difference between 32-bit and 64-bit
      by making __secondary_hold be the text address of the secondary CPU
      spinloop rather than a function descriptor for it.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1f6a93e4
    • P
      powerpc: Rearrange head_64.S to move interrupt handler code to the beginning · 9a955167
      Paul Mackerras 提交于
      This rearranges head_64.S so that we have all the first-level exception
      prologs together starting at 0x100, followed by all the second-level
      handlers that are invoked from the first-level prologs, followed by
      other code.  This doesn't make any functional change but will make
      following changes for relocatable kernel support easier.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      9a955167
    • C
      powerpc: Add support for dynamic reconfiguration memory in kexec/kdump kernels · cf00085d
      Chandru 提交于
      Kdump kernel needs to use only those memory regions that it is allowed
      to use (crashkernel, rtas, tce, etc.).  Each of these regions have
      their own sizes and are currently added under 'linux,usable-memory'
      property under each memory@xxx node of the device tree.
      
      The ibm,dynamic-memory property of ibm,dynamic-reconfiguration-memory
      node (on POWER6) now stores in it the representation for most of the
      logical memory blocks with the size of each memory block being a
      constant (lmb_size).  If one or more or part of the above mentioned
      regions lie under one of the lmb from ibm,dynamic-memory property,
      there is a need to identify those regions within the given lmb.
      
      This makes the kernel recognize a new 'linux,drconf-usable-memory'
      property added by kexec-tools.  Each entry in this property is of the
      form of a count followed by that many (base, size) pairs for the above
      mentioned regions.  The number of cells in the count value is given by
      the #size-cells property of the root node.
      Signed-off-by: NChandru Siddalingappa <chandru@in.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      cf00085d
    • N
      powerpc: Check rc of notifier chain for memory remove · 525c411d
      Nathan Fontenot 提交于
      The return code from invocation of the notifier for
      pSeries_reconfig_chain during update of the device tree is not
      checked.  This causes writes to /proc/ppc64/ofdt to update memory
      properties (i.e. ibm,dyamic-reconfiguration-memory) to always
      return success, instead of the result of the notifier chain.
      
      This happens specifically when we remove/add memory from the
      device tree on machines using memory specified in the
      ibm,dynamic-reconfiguration-memory property of the device tree.
      Signed-off-by: NNathan Fontenot <nfont@austin.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      525c411d
    • M
      powerpc: New copy_4K_page() · 57dda6ef
      Mark Nelson 提交于
      This new copy_4K_page() function was originally tuned for the best
      performance on the Cell processor, but after testing on more 64bit
      powerpc chips it was found that with a small modification it either
      matched the performance offered by the current mainline version or
      bettered it by a small amount.
      
      It was found that on a Cell-based QS22 blade the amount of system
      time measured when compiling a 2.6.26 pseries_defconfig decreased
      by 4%. Using the same test, a 4-way 970MP machine saw a decrease of
      2% in system time. No noticeable change was seen on Power4, Power5
      or Power6.
      
      The 4096 byte page is copied in thirty-two 128 byte strides. An
      initial setup loop executes dcbt instructions for the whole source
      page and dcbz instructions for the whole destination page. To do
      this, the cache line size is retrieved from ppc64_caches.
      
      A new CPU feature bit, CPU_FTR_CP_USE_DCBTZ, (introduced in the
      previous patch) is used to make the modification to this new copy
      routine - on Power4, 970 and Cell the feature bit is set so the
      setup loop is executed, but on all other 64bit chips the setup
      loop is nop'ed out.
      Signed-off-by: NMark Nelson <markn@au1.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      57dda6ef
    • 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
    • R
      powerpc: Fix duplicate test of MACIO_FLAG_SCCB_ON · 1b3c83e6
      roel kluin 提交于
      Evidently MACIO_FLAG_SCCA_ON was meant.
      Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1b3c83e6
  2. 10 9月, 2008 1 次提交
  3. 08 9月, 2008 2 次提交
    • H
      powerpc: Fix rare boot build breakage · 4ff23fa9
      Hugh Dickins 提交于
      A make -j20 powerpc kernel build broke a couple of months ago saying:
      In file included from arch/powerpc/boot/gunzip_util.h:13,
                       from arch/powerpc/boot/prpmc2800.c:21:
      arch/powerpc/boot/zlib.h:85: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
      arch/powerpc/boot/zlib.h:630: warning: type defaults to ‘int’ in declaration of ‘Byte’
      arch/powerpc/boot/zlib.h:630: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
      
      It happened again yesterday: too rare for me to confirm the fix, but
      it looks like the list of dependants on gunzip_util.h was incomplete.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      4ff23fa9
    • A
      powerpc/spufs: Fix possible scheduling of a context to multiple SPEs · b2e601d1
      Andre Detsch 提交于
      We currently have a race when scheduling a context to a SPE -
      after we have found a runnable context in spusched_tick, the same
      context may have been scheduled by spu_activate().
      
      This may result in a panic if we try to unschedule a context that has
      been freed in the meantime.
      
      This change exits spu_schedule() if the context has already been
      scheduled, so we don't end up scheduling it twice.
      Signed-off-by: NAndre Detsch <adetsch@br.ibm.com>
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      b2e601d1
  4. 05 9月, 2008 2 次提交
    • J
      powerpc/spufs: Fix race for a free SPU · b65fe035
      Jeremy Kerr 提交于
      We currently have a race for a free SPE. With one thread doing a
      spu_yield(), and another doing a spu_activate():
      
      thread 1				thread 2
      spu_yield(oldctx)			spu_activate(ctx)
        __spu_deactivate(oldctx)
        spu_unschedule(oldctx, spu)
        spu->alloc_state = SPU_FREE
      					spu = spu_get_idle(ctx)
      					    - searches for a SPE in
      					      state SPU_FREE, gets
      					      the context just
      					      freed by thread 1
      					spu_schedule(ctx, spu)
      					  spu->alloc_state = SPU_USED
      spu_schedule(newctx, spu)
        - assumes spu is still free
        - tries to schedule context on
          already-used spu
      
      This change introduces a 'free_spu' flag to spu_unschedule, to indicate
      whether or not the function should free the spu after descheduling the
      context. We only set this flag if we're not going to re-schedule
      another context on this SPU.
      
      Add a comment to document this behaviour.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      b65fe035
    • J
      powerpc/spufs: Fix multiple get_spu_context() · 9f43e391
      Jeremy Kerr 提交于
      Commit 8d5636fb introduced a reference
      count on SPU contexts during find_victim, but this may cause a leak in
      the reference count if we later find a better contender for a context to
      unschedule.
      
      Change the reference to after we've found our victim context, so we
      don't do the extra get_spu_context().
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      9f43e391
  5. 03 9月, 2008 6 次提交
  6. 27 8月, 2008 1 次提交
  7. 26 8月, 2008 5 次提交
  8. 24 8月, 2008 1 次提交
  9. 21 8月, 2008 6 次提交
  10. 20 8月, 2008 4 次提交