1. 15 Aug, 2017 4 commits
    • Michael Ellerman's avatar
      powerpc/iommu: Avoid undefined right shift in iommu_range_alloc() · 63b85621
      Michael Ellerman authored
      In iommu_range_alloc() we generate a mask by right shifting ~0,
      however if the specified alignment is 0 then we right shift by 64,
      which is undefined. UBSAN tells us so:
      
        UBSAN: Undefined behaviour in ../arch/powerpc/kernel/iommu.c:193:35
        shift exponent 64 is too large for 64-bit type 'long unsigned int'
      
      We can avoid it by instead generating the mask with:
      
        align_mask = (1ull << align_order) - 1;
      
      That will also generate an undefined shift if align_order is 64 or
      greater, but that shouldn't be a problem for a while.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      63b85621
    • Anju T's avatar
      powerpc/perf/imc: Fix nest events on muti socket system · 7efbae90
      Anju T authored
      In a multi node system with discontiguous node ids, nest event values
      are not showing up properly. eg. lscpu output:
      
        NUMA node0 CPU(s): 0-15
        NUMA node8 CPU(s): 16-31
      
      Nest event values on such systems can be counted on CPUs <= 15:
      
        $./perf stat -e 'nest_powerbus0_imc/PM_PB_CYC/' -C 0-14 -I 1000 sleep 1000
        #           time             counts unit events
             1.000294577    30,17,24,42,880 nest_powerbus0_imc/PM_PB_CYC/
      
      But not on CPUs >= 16:
      
        $./perf stat -e 'nest_powerbus0_imc/PM_PB_CYC/' -C 16-28 -I 1000 sleep 1000
        #           time             counts unit events
             1.000049902    <not supported> nest_powerbus0_imc/PM_PB_CYC/
      
      This is because, when fetching the reference count, the node id (which
      may be sparse) is used as the array index, not the node number (which
      is 0 based and contiguous).
      
      Fix it by using the node number as the array index.
      
        $./perf stat -e 'nest_powerbus0_imc/PM_PB_CYC/' -C 16-28 -I 1000 sleep 1000
        #           time             counts unit events
             1.000241961    26,12,35,28,704 nest_powerbus0_imc/PM_PB_CYC/
      Signed-off-by: default avatarAnju T Sudhakar <anju@linux.vnet.ibm.com>
      [mpe: Change log tweaks for clarity and brevity]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      7efbae90
    • Michael Ellerman's avatar
      powerpc/mm/nohash: Move definition of PGALLOC_GFP to fix build errors · 5b6c133e
      Michael Ellerman authored
      In some obscure Book3E configs (randconfig) we can end up missing a
      definition for PGALLOC_GFP in pgtable_64.c.
      
      Fix it by moving the definition to asm/pgalloc.h.
      
      Fixes: de3b8761 ("powerpc/mm/book(e)(3s)/64: Add page table accounting")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      5b6c133e
    • Naveen N. Rao's avatar
      powerpc/xmon: Exclude all of xmon from ftrace · e12d94f8
      Naveen N. Rao authored
      Exclude core xmon files from ftrace (along with an xmon xive helper
      outside of xmon/) to minimize impact of ftrace while within xmon.
      
      Before:
        /sys/kernel/debug/tracing# grep -ci xmon available_filter_functions
        26
      
      After:
        /sys/kernel/debug/tracing# grep -ci xmon available_filter_functions
        0
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      [mpe: Use $(subst ..) on KBUILD_CFLAGS rather than CFLAGS_REMOVE_xxx]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      e12d94f8
  2. 14 Aug, 2017 5 commits
  3. 10 Aug, 2017 31 commits