1. 28 Jun, 2017 4 commits
    • Hari Bathini's avatar
      powerpc/fadump: avoid holes in boot memory area when fadump is registered · eae0dfcc
      Hari Bathini authored
      To register fadump, boot memory area - the size of low memory chunk that
      is required for a kernel to boot successfully when booted with restricted
      memory, is assumed to have no holes. But this memory area is currently
      not protected from hot-remove operations. So, fadump could fail to
      re-register after a memory hot-remove operation, if memory is removed
      from boot memory area. To avoid this, ensure that memory from boot
      memory area is not hot-removed when fadump is registered.
      Signed-off-by: default avatarHari Bathini <hbathini@linux.vnet.ibm.com>
      Reviewed-by: default avatarMahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      eae0dfcc
    • Hari Bathini's avatar
      powerpc/fadump: avoid duplicates in crash memory ranges · a77af552
      Hari Bathini authored
      fadump sets up crash memory ranges to be used for creating PT_LOAD
      program headers in elfcore header. Memory chunk RMA_START through
      boot memory area size is added as the first memory range because
      firmware, at the time of crash, moves this memory chunk to different
      location specified during fadump registration making it necessary to
      create a separate program header for it with the correct offset.
      This memory chunk is skipped while setting up the remaining memory
      ranges. But currently, there is possibility that some of this memory
      may have duplicate entries like when it is hot-removed and added
      again. Ensure that no two memory ranges represent the same memory.
      
      When 5 lmbs are hot-removed and then hot-plugged before registering
      fadump, here is how the program headers in /proc/vmcore exported by
      fadump look like
      
      without this change:
      
        Program Headers:
          Type           Offset             VirtAddr           PhysAddr
                         FileSiz            MemSiz              Flags  Align
          NOTE           0x0000000000010000 0x0000000000000000 0x0000000000000000
                         0x0000000000001894 0x0000000000001894         0
          LOAD           0x0000000000021020 0xc000000000000000 0x0000000000000000
                         0x0000000040000000 0x0000000040000000  RWE    0
          LOAD           0x0000000040031020 0xc000000000000000 0x0000000000000000
                         0x0000000010000000 0x0000000010000000  RWE    0
          LOAD           0x0000000050040000 0xc000000010000000 0x0000000010000000
                         0x0000000050000000 0x0000000050000000  RWE    0
          LOAD           0x00000000a0040000 0xc000000060000000 0x0000000060000000
                         0x000000019ffe0000 0x000000019ffe0000  RWE    0
      
      and with this change:
      
        Program Headers:
          Type           Offset             VirtAddr           PhysAddr
                         FileSiz            MemSiz              Flags  Align
          NOTE           0x0000000000010000 0x0000000000000000 0x0000000000000000
                         0x0000000000001894 0x0000000000001894         0
          LOAD           0x0000000000021020 0xc000000000000000 0x0000000000000000
                         0x0000000040000000 0x0000000040000000  RWE    0
          LOAD           0x0000000040030000 0xc000000040000000 0x0000000040000000
                         0x0000000020000000 0x0000000020000000  RWE    0
          LOAD           0x0000000060030000 0xc000000060000000 0x0000000060000000
                         0x000000019ffe0000 0x000000019ffe0000  RWE    0
      Signed-off-by: default avatarHari Bathini <hbathini@linux.vnet.ibm.com>
      Reviewed-by: default avatarMahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      a77af552
    • Madhavan Srinivasan's avatar
      powerpc/perf: Fix branch event code for power9 · 24bedcb7
      Madhavan Srinivasan authored
      Correct "branch" event code of Power9 is "r4d05e". Replace the current
      "branch" event code with "r4d05e" and add a hack to use "r10012" as
      event code for Power9 DD1.
      
      Fixes: d89f473f ("powerpc/perf: Fix PM_BRU_CMPL event code for power9")
      Reported-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      24bedcb7
    • Benjamin Herrenschmidt's avatar
      powerpc/xive: Silence message about VP block allocation · 89d8bb16
      Benjamin Herrenschmidt authored
      There is no reason for that message to be pr_info(), it will be printed
      every time we start a KVM guest.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      89d8bb16
  2. 27 Jun, 2017 10 commits
  3. 23 Jun, 2017 1 commit
    • Balbir Singh's avatar
      powerpc/mm: Trace tlbie(l) instructions · 0428491c
      Balbir Singh authored
      Add a trace point for tlbie(l) (Translation Lookaside Buffer Invalidate
      Entry (Local)) instructions.
      
      The tlbie instruction has changed over the years, so not all versions
      accept the same operands. Use the ISA v3 field operands because they are
      the most verbose, we may change them in future.
      
      Example output:
      
        qemu-system-ppc-5371  [016]  1412.369519: tlbie:
        	tlbie with lpid 0, local 1, rb=67bd8900174c11c1, rs=0, ric=0 prs=0 r=0
      Signed-off-by: default avatarBalbir Singh <bsingharora@gmail.com>
      [mpe: Add some missing trace_tlbie()s, reword change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      0428491c
  4. 22 Jun, 2017 1 commit
    • Paul Mackerras's avatar
      powerpc: Convert VDSO update function to use new update_vsyscall interface · d4cfb113
      Paul Mackerras authored
      This converts the powerpc VDSO time update function to use the new
      interface introduced in commit 576094b7 ("time: Introduce new
      GENERIC_TIME_VSYSCALL", 2012-09-11).  Where the old interface gave
      us the time as of the last update in seconds and whole nanoseconds,
      with the new interface we get the nanoseconds part effectively in
      a binary fixed-point format with tk->tkr_mono.shift bits to the
      right of the binary point.
      
      With the old interface, the fractional nanoseconds got truncated,
      meaning that the value returned by the VDSO clock_gettime function
      would have about 1ns of jitter in it compared to the value computed
      by the generic timekeeping code in the kernel.
      
      The powerpc VDSO time functions (clock_gettime and gettimeofday)
      already work in units of 2^-32 seconds, or 0.23283 ns, because that
      makes it simple to split the result into seconds and fractional
      seconds, and represent the fractional seconds in either microseconds
      or nanoseconds.  This is good enough accuracy for now, so this patch
      avoids changing how the VDSO works or the interface in the VDSO data
      page.
      
      This patch converts the powerpc update_vsyscall_old to be called
      update_vsyscall and use the new interface.  We convert the fractional
      second to units of 2^-32 seconds without truncating to whole nanoseconds.
      (There is still a conversion to whole nanoseconds for any legacy users
      of the vdso_data/systemcfg stamp_xtime field.)
      
      In addition, this improves the accuracy of the computation of tb_to_xs
      for those systems with high-frequency timebase clocks (>= 268.5 MHz)
      by doing the right shift in two parts, one before the multiplication and
      one after, rather than doing the right shift before the multiplication.
      (We can't do all of the right shift after the multiplication unless we
      use 128-bit arithmetic.)
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      Acked-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      d4cfb113
  5. 21 Jun, 2017 4 commits
  6. 20 Jun, 2017 9 commits
  7. 19 Jun, 2017 9 commits
  8. 15 Jun, 2017 2 commits
    • Murilo Opsfelder Araujo's avatar
      drivers/watchdog/Kconfig: Update CONFIG_WATCHDOG_RTAS dependencies · 42bed042
      Murilo Opsfelder Araujo authored
      drivers/watchdog/wdrtas.c uses symbols defined in arch/powerpc/kernel/rtas.c,
      which are exported iff CONFIG_PPC_RTAS is selected. Building wdrtas.c without
      setting CONFIG_PPC_RTAS throws the following errors:
      
          ERROR: ".rtas_token" [drivers/watchdog/wdrtas.ko] undefined!
          ERROR: "rtas_data_buf" [drivers/watchdog/wdrtas.ko] undefined!
          ERROR: "rtas_data_buf_lock" [drivers/watchdog/wdrtas.ko] undefined!
          ERROR: ".rtas_get_sensor" [drivers/watchdog/wdrtas.ko] undefined!
          ERROR: ".rtas_call" [drivers/watchdog/wdrtas.ko] undefined!
      
      This was identified during a randconfig build where CONFIG_WATCHDOG_RTAS=m and
      CONFIG_PPC_RTAS was not set. Logs are here:
      
          http://kisskb.ellerman.id.au/kisskb/buildresult/12982152/
      
      This patch fixes the issue by updating CONFIG_WATCHDOG_RTAS to depend on just
      CONFIG_PPC_RTAS, removing COMPILE_TEST entirely.
      Signed-off-by: default avatarMurilo Opsfelder Araujo <mopsfelder@gmail.com>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      42bed042
    • Nicholas Piggin's avatar
      powerpc/64s: Avoid cpabort in context switch when possible · 07d2a628
      Nicholas Piggin authored
      The ISA v3.0B copy-paste facility only requires cpabort when switching
      to a process that has foreign real addresses mapped (direct access to
      accelerators), to clear a potential copy buffer filled by a previous
      thread. There is no accelerator driver implemented yet, so cpabort can
      be removed. It can be be re-added when a driver is implemented.
      
      POWER9 DD1 requires the copy buffer to always be cleared on context
      switch, but if accelerators are not in use, then an unpaired copy from
      a dummy region is sufficient to clear data out of the copy buffer.
      
      This increases context switch performance by about 5% on POWER9.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      07d2a628