1. 19 6月, 2017 4 次提交
  2. 15 6月, 2017 1 次提交
    • N
      powerpc/64s: Optimize hypercall/syscall entry · acd7d8ce
      Nicholas Piggin 提交于
      After bc355125 ("powerpc/64: Allow for relocation-on interrupts from
      guest to host"), a getppid() system call goes from 307 cycles to 358
      cycles (+17%) on POWER8. This is due significantly to the scratch SPR
      used by the hypercall check.
      
      It turns out there are a some volatile registers common to both system
      call and hypercall (in particular, r12, cr0, ctr), which can be used to
      avoid the SPR and some other overheads. This brings getppid to 320 cycles
      (+4%).
      
      Testing hcall entry performance by running "sc 1" in guest userspace
      before this patch is 854 cycles, afterwards is 826. Also a small win
      there.
      
      POWER9 syscall is improved by about the same amount, hcall not tested.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      acd7d8ce
  3. 09 5月, 2017 1 次提交
    • N
      powerpc/64s: Fix unnecessary machine check handler relocation branch · 6102c005
      Nicholas Piggin 提交于
      Similarly to commit 2563a70c ("powerpc/64s: Remove unnecessary relocation
      branch from idle handler"), the machine check handler has a BRANCH_TO from
      relocated to relocated code, which is unnecessary.
      
      It has also caused build errors with some toolchains:
      
        arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
        arch/powerpc/kernel/exceptions-64s.S:395: Error: operand out of range
        (0xffffffffffff8280 is not between 0x0000000000000000 and
        0x000000000000ffff)
      
      Fixes: 1945bc45 ("powerpc/64s: Fix POWER9 machine check handler from stop state")
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Reported-and-tested-by : Abdul Haleem <abdhalee@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      6102c005
  4. 28 4月, 2017 5 次提交
  5. 23 4月, 2017 4 次提交
  6. 18 4月, 2017 1 次提交
    • M
      powerpc/64: Fix HMI exception on LE with CONFIG_RELOCATABLE=y · be5c5e84
      Michael Ellerman 提交于
      Prior to commit 2337d207 ("powerpc/64: CONFIG_RELOCATABLE support for hmi
      interrupts"), the branch from hmi_exception_early() to hmi_exception_realmode()
      was just a bl hmi_exception_realmode, which the linker would turn into a bl to
      the local entry point of hmi_exception_realmode. This was broken when
      CONFIG_RELOCATABLE=y because hmi_exception_realmode() is not in the low part of
      the kernel text that is copied down to 0x0.
      
      But in fixing that, we added a new bug on little endian kernels. Because the
      branch is now a bctrl when CONFIG_RELOCATABLE=y, we branch to the global entry
      point of hmi_exception_realmode(). The global entry point must be called with
      r12 containing the address of hmi_exception_realmode(), because it uses that
      value to calculate the TOC value (r2).
      
      This may manifest as a checkstop, because we take a junk value from r12 which
      came from HSRR1, add a small constant to it and then use that as the TOC
      pointer. The HSRR1 value will have 0x9 as the top nibble, which puts it above
      RAM and somewhere in MMIO space.
      
      Fix it by changing the BRANCH_LINK_TO_FAR() macro to always use r12 to load the
      label we're branching to. This means r12 will be setup correctly on LE, fixing
      this bug, and r12 is also volatile across function calls on BE so it's a good
      choice anyway.
      
      Fixes: 2337d207 ("powerpc/64: CONFIG_RELOCATABLE support for hmi interrupts")
      Reported-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Acked-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      be5c5e84
  7. 07 2月, 2017 3 次提交
  8. 31 1月, 2017 3 次提交
  9. 27 1月, 2017 1 次提交
  10. 14 11月, 2016 1 次提交
    • N
      powerpc/64s: Reduce exception alignment · f4329f2e
      Nicholas Piggin 提交于
      Exception handlers are aligned to 128 bytes (L1 cache) on 64s, which is
      overkill. It can reduce the icache footprint of any individual exception
      path. However taken as a whole, the expansion in icache footprint seems
      likely to be counter-productive and cause more total misses.
      
      Create IFETCH_ALIGN_SHIFT/BYTES, which should give optimal ifetch
      alignment with much more reasonable alignment. This saves 1792 bytes
      from head_64.o text with an allmodconfig build.
      
      Other subarchitectures should define appropriate IFETCH_ALIGN_SHIFT
      values if this becomes more widely used.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f4329f2e
  11. 12 11月, 2016 1 次提交
  12. 27 10月, 2016 1 次提交
    • N
      powerpc/64s: relocation, register save fixes for system reset interrupt · fb479e44
      Nicholas Piggin 提交于
      This patch does a couple of things. First of all, powernv immediately
      explodes when running a relocated kernel, because the system reset
      exception for handling sleeps does not do correct relocated branches.
      
      Secondly, the sleep handling code trashes the condition and cfar
      registers, which we would like to preserve for debugging purposes (for
      non-sleep case exception).
      
      This patch changes the exception to use the standard format that saves
      registers before any tests or branches are made. It adds the test for
      idle-wakeup as an "extra" to break out of the normal exception path.
      Then it branches to a relocated idle handler that calls the various
      idle handling functions.
      
      After this patch, POWER8 CPU simulator now boots powernv kernel that is
      running at non-zero.
      
      Fixes: 948cf67c ("powerpc: Add NAP mode support on Power7 in HV mode")
      Cc: stable@vger.kernel.org # v3.0+
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Acked-by: NGautham R. Shenoy <ego@linux.vnet.ibm.com>
      Acked-by: NBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      fb479e44
  13. 11 10月, 2016 1 次提交
  14. 04 10月, 2016 13 次提交