1. 12 7月, 2011 1 次提交
    • P
      powerpc, KVM: Rework KVM checks in first-level interrupt handlers · b01c8b54
      Paul Mackerras 提交于
      Instead of branching out-of-line with the DO_KVM macro to check if we
      are in a KVM guest at the time of an interrupt, this moves the KVM
      check inline in the first-level interrupt handlers.  This speeds up
      the non-KVM case and makes sure that none of the interrupt handlers
      are missing the check.
      
      Because the first-level interrupt handlers are now larger, some things
      had to be move out of line in exceptions-64s.S.
      
      This all necessitated some minor changes to the interrupt entry code
      in KVM.  This also streamlines the book3s_32 KVM test.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b01c8b54
  2. 19 5月, 2011 1 次提交
    • M
      powerpc/iseries: Cleanup and fix secondary startup · 7c827337
      Milton Miller 提交于
      9cb82f2f (Make iSeries spin on
      __secondary_hold_spinloop, like pSeries) added a load of current_set
      but this load was repeated later and we don't even have the paca yet.
      It also checked __secondary_hold_spinloop with a 32 bit compare instead
      of a 64 bit compare.
      
      b6f6b98a (Don't spin on sync instruction
      at boot time) missed the copy of the startup code in iseries.
      
      1426d5a3 (Dynamically allocate pacas)
      doesn't allow for pacas to be less than lppacas and recalculated the paca
      location from the cpu id in r0 every time through the secondary loop.
      
      Various revisions over time made the comments on conditional branches
      confusing with respect to being a hold loop or forward progress
      
      Mostly in-order description of the changes:
      
      Replicate the few lines of code saved by the ugly scoped ifdef CONFIG_SMP
      in the secondary loop between yielding on UP and marking time with the
      hypervisor on SMP.  Always compile the iseries_secondary_yield loop and
      use it if the cpu id is above nr_cpu_ids.  Change all forward progress
      paths to be forward branches to the next numerical label.  Assign a
      label to all loops.  Move all sync instructions from the loops to the
      forward progress path.  Wait to load current_set until paca is set to go.
      Move the iseries_secondary_smp_loop label to cover the whole spin loop.
      Add HMT_MEDIUM when we make forward progress.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7c827337
  3. 27 4月, 2011 1 次提交
  4. 20 4月, 2011 2 次提交
  5. 21 5月, 2010 1 次提交
    • P
      powerpc: Avoid bad relocations in iSeries code · e62cee42
      Paul Mackerras 提交于
      Subrata Modak reported that building a CONFIG_RELOCATABLE kernel with
      CONFIG_ISERIES enabled gives the following warnings:
      
      WARNING: 4 bad relocations
      c00000000007216e R_PPC64_ADDR16_HIGHEST  __ksymtab+0x00000000009dcec8
      c000000000072172 R_PPC64_ADDR16_HIGHER  __ksymtab+0x00000000009dcec8
      c00000000007217a R_PPC64_ADDR16_HI  __ksymtab+0x00000000009dcec8
      c00000000007217e R_PPC64_ADDR16_LO  __ksymtab+0x00000000009dcec8
      
      The reason is that decrementer_iSeries_masked is using
      LOAD_REG_IMMEDIATE to get the address of a kernel symbol, which
      creates relocations that aren't handled by the kernel relocator code.
      
      Instead of reading the tb_ticks_per_jiffy variable, we can just set
      the decrementer to its maximum value (0x7fffffff) and that will work
      just as well.  In fact timer_interrupt sets the decrementer to that
      value initially anyway, and we are sure to get into timer_interrupt
      once interrupts are reenabled because we store 1 to the decrementer
      interrupt flag in the lppaca (LPPACADECRINT(r12) here).
      Reported-by: NSubrata Modak <subrata@linux.vnet.ibm.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e62cee42
  6. 09 3月, 2010 1 次提交
    • M
      powerpc: Dynamically allocate pacas · 1426d5a3
      Michael Ellerman 提交于
      On 64-bit kernels we currently have a 512 byte struct paca_struct for
      each cpu (usually just called "the paca"). Currently they are statically
      allocated, which means a kernel built for a large number of cpus will
      waste a lot of space if it's booted on a machine with few cpus.
      
      We can avoid that by only allocating the number of pacas we need at
      boot. However this is complicated by the fact that we need to access
      the paca before we know how many cpus there are in the system.
      
      The solution is to dynamically allocate enough space for NR_CPUS pacas,
      but then later in boot when we know how many cpus we have, we free any
      unused pacas.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1426d5a3
  7. 20 8月, 2009 2 次提交
    • B
      powerpc: Remove use of a second scratch SPRG in STAB code · c5a8c0c9
      Benjamin Herrenschmidt 提交于
      The STAB code used on Power3 and RS/64 uses a second scratch SPRG to
      save a GPR in order to decide whether to go to do_stab_bolted_* or
      to handle a normal data access exception.
      
      This prevents our scheme of freeing SPRG3 which is user visible for
      user uses since we cannot use SPRG0 which, on RS/64, seems to be
      read-only for supervisor mode (like POWER4).
      
      This reworks the STAB exception entry to use the PACA as temporary
      storage instead.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c5a8c0c9
    • B
      powerpc: Use names rather than numbers for SPRGs (v2) · ee43eb78
      Benjamin Herrenschmidt 提交于
      The kernel uses SPRG registers for various purposes, typically in
      low level assembly code as scratch registers or to hold per-cpu
      global infos such as the PACA or the current thread_info pointer.
      
      We want to be able to easily shuffle the usage of those registers
      as some implementations have specific constraints realted to some
      of them, for example, some have userspace readable aliases, etc..
      and the current choice isn't always the best.
      
      This patch should not change any code generation, and replaces the
      usage of SPRN_SPRGn everywhere in the kernel with a named replacement
      and adds documentation next to the definition of the names as to
      what those are used for on each processor family.
      
      The only parts that still use the original numbers are bits of KVM
      or suspend/resume code that just blindly needs to save/restore all
      the SPRGs.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ee43eb78
  8. 16 9月, 2008 1 次提交
    • 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
  9. 24 4月, 2008 1 次提交
  10. 15 4月, 2008 1 次提交
  11. 22 8月, 2007 4 次提交