1. 14 8月, 2013 1 次提交
    • P
      powerpc: Fix denormalized exception handler · 630573c1
      Paul Mackerras 提交于
      The denormalized exception handler (denorm_exception_hv) has a couple
      of bugs.  If the CONFIG_PPC_DENORMALISATION option is not selected,
      or the HSRR1_DENORM bit is not set in HSRR1, we don't test whether the
      interrupt occurred within a KVM guest.  On the other hand, if the
      HSRR1_DENORM bit is set and CONFIG_PPC_DENORMALISATION is enabled,
      we corrupt the CFAR and PPR.
      
      To correct these problems, this replaces the open-coded version of
      EXCEPTION_PROLOG_1 that is there currently, and that is missing the
      saving of PPR and CFAR values to the PACA, with an instance of
      EXCEPTION_PROLOG_1.  This adds an explicit KVMTEST after testing
      whether the exception is one we can handle, and adds code to restore
      the CFAR on exit.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      630573c1
  2. 01 7月, 2013 4 次提交
  3. 15 6月, 2013 1 次提交
    • P
      powerpc: Fix emulation of illegal instructions on PowerNV platform · bf593907
      Paul Mackerras 提交于
      Normally, the kernel emulates a few instructions that are unimplemented
      on some processors (e.g. the old dcba instruction), or privileged (e.g.
      mfpvr).  The emulation of unimplemented instructions is currently not
      working on the PowerNV platform.  The reason is that on these machines,
      unimplemented and illegal instructions cause a hypervisor emulation
      assist interrupt, rather than a program interrupt as on older CPUs.
      Our vector for the emulation assist interrupt just calls
      program_check_exception() directly, without setting the bit in SRR1
      that indicates an illegal instruction interrupt.  This fixes it by
      making the emulation assist interrupt set that bit before calling
      program_check_interrupt().  With this, old programs that use no-longer
      implemented instructions such as dcba now work again.
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bf593907
  4. 10 6月, 2013 2 次提交
  5. 30 4月, 2013 1 次提交
  6. 26 4月, 2013 2 次提交
    • 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
    • M
      powerpc: Fix hardware IRQs with MMU on exceptions when HV=0 · 3e96ca7f
      Michael Neuling 提交于
      POWER8 allows us to take interrupts with the MMU on.  This gives us a
      second set of vectors offset at 0x4000.
      
      Unfortunately when coping these vectors we missed checking for MSR HV
      for hardware interrupts (0x500).  This results in us trying to use
      HSRR0/1 when HV=0, rather than SRR0/1 on HW IRQs
      
      The below fixes this to check CPU_FTR_HVMODE when patching the code at
      0x4500.
      
      Also we remove the check for CPU_FTR_ARCH_206 since relocation on IRQs
      are only available in arch 2.07 and beyond.
      
      Thanks to benh for helping find this.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3e96ca7f
  7. 18 4月, 2013 1 次提交
  8. 25 3月, 2013 1 次提交
  9. 17 3月, 2013 2 次提交
  10. 05 3月, 2013 1 次提交
  11. 15 2月, 2013 4 次提交
    • M
      powerpc: Hook in new transactional memory code · bc2a9408
      Michael Neuling 提交于
      This hooks the new transactional memory code into context switching, FP/VMX/VMX
      unavailable and exception return.
      Signed-off-by: NMatt Evans <matt@ozlabs.org>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      bc2a9408
    • M
      powerpc: Add transactional memory unavaliable execption handler · d0c0c9a1
      Michael Neuling 提交于
      These should never happen since we always turn on MSR TM when in userspace. We
      don't do lazy TM.
      
      Hence if we hit this, we barf and kill the task as something's gone horribly
      wrong.
      Signed-off-by: NMatt Evans <matt@ozlabs.org>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d0c0c9a1
    • P
      powerpc: Save CFAR before branching in interrupt entry paths · 1707dd16
      Paul Mackerras 提交于
      Some of the interrupt vectors on 64-bit POWER server processors are
      only 32 bytes long, which is not enough for the full first-level
      interrupt handler.  For these we currently just have a branch to an
      out-of-line handler.  However, this means that we corrupt the CFAR
      (come-from address register) on POWER7 and later processors.
      
      To fix this, we split the EXCEPTION_PROLOG_1 macro into two pieces:
      EXCEPTION_PROLOG_0 contains the part up to the point where the CFAR
      is saved in the PACA, and EXCEPTION_PROLOG_1 contains the rest.  We
      then put EXCEPTION_PROLOG_0 in the short interrupt vectors before
      we branch to the out-of-line handler, which contains the rest of the
      first-level interrupt handler.  To facilitate this, we define new
      _OOL (out of line) variants of STD_EXCEPTION_PSERIES, etc.
      
      In order to get EXCEPTION_PROLOG_0 to be short enough, i.e., no more
      than 6 instructions, it was necessary to move the stores that move
      the PPR and CFAR values into the PACA into __EXCEPTION_PROLOG_1 and
      to get rid of one of the two HMT_MEDIUM instructions.  Previously
      there was a HMT_MEDIUM_PPR_DISCARD before the prolog, which was
      nop'd out on processors with the PPR (POWER7 and later), and then
      another HMT_MEDIUM inside the HMT_MEDIUM_PPR_SAVE macro call inside
      __EXCEPTION_PROLOG_1, which was nop'd out on processors without PPR.
      Now the HMT_MEDIUM inside EXCEPTION_PROLOG_0 is there unconditionally
      and the HMT_MEDIUM_PPR_DISCARD is not strictly necessary, although
      this leaves it in for the interrupt vectors where there is room for
      it.
      
      Previously we had a handler for hypervisor maintenance interrupts at
      0xe50, which doesn't leave enough room for the vector for hypervisor
      emulation assist interrupts at 0xe40, since we need 8 instructions.
      The 0xe50 vector was only used on POWER6, as the HMI vector was moved
      to 0xe60 on POWER7.  Since we don't support running in hypervisor mode
      on POWER6, we just remove the handler at 0xe50.
      
      This also changes denorm_exception_hv to use EXCEPTION_PROLOG_0
      instead of open-coding it, and removes the HMT_MEDIUM_PPR_DISCARD
      from the relocation-on vectors (since any CPU that supports
      relocation-on interrupts also has the PPR).
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1707dd16
    • P
      powerpc: Remove Cell-specific relocation-on interrupt vector code · 6100209b
      Paul Mackerras 提交于
      The Cell processor doesn't support relocation-on interrupts, so we
      don't need relocation-on versions of the interrupt vectors that are
      purely Cell-specific.  This removes them.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6100209b
  12. 10 1月, 2013 6 次提交
  13. 15 11月, 2012 7 次提交
  14. 17 9月, 2012 2 次提交
  15. 05 9月, 2012 1 次提交
    • P
      powerpc: Give hypervisor decrementer interrupts their own handler · dabe859e
      Paul Mackerras 提交于
      At the moment the handler for hypervisor decrementer interrupts is
      the same as for decrementer interrupts, i.e. timer_interrupt().
      This is bogus; if we ever do get a hypervisor decrementer interrupt
      it won't have anything to do with the next timer event.  In fact
      the only time we get hypervisor decrementer interrupts is when one
      is left pending on exit from a KVM guest.
      
      When we get a hypervisor decrementer interrupt we don't need to do
      anything special to clear it, since they are edge-triggered on the
      transition of HDEC from 0 to -1.  Thus this adds an empty handler
      function for them.  We don't need to have them masked when interrupts
      are soft-disabled, so we use STD_EXCEPTION_HV instead of
      MASKABLE_EXCEPTION_HV.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      dabe859e
  16. 11 7月, 2012 2 次提交
  17. 09 5月, 2012 1 次提交
  18. 30 4月, 2012 1 次提交