1. 03 Apr, 2017 3 commits
    • Anton Blanchard's avatar
      powerpc: Avoid taking a data miss on every userspace instruction miss · a7a9dcd8
      Anton Blanchard authored
      Early on in do_page_fault() we call store_updates_sp(), regardless of
      the type of exception. For an instruction miss this doesn't make
      sense, because we only use this information to detect if a data miss
      is the result of a stack expansion instruction or not.
      
      Worse still, it results in a data miss within every userspace
      instruction miss handler, because we try and load the very instruction
      we are about to install a pte for!
      
      A simple exec microbenchmark runs 6% faster on POWER8 with this fix:
      
       #include <stdlib.h>
       #include <stdio.h>
       #include <unistd.h>
      
      int main(int argc, char *argv[])
      {
      	unsigned long left = atol(argv[1]);
      	char leftstr[16];
      
      	if (left-- == 0)
      		return 0;
      
      	sprintf(leftstr, "%ld", left);
      	execlp(argv[0], argv[0], leftstr, NULL);
      	perror("exec failed\n");
      
      	return 0;
      }
      
      Pass the number of iterations on the command line (eg 10000) and time
      how long it takes to execute.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      a7a9dcd8
    • Michael Ellerman's avatar
      powerpc/book3s: Print task info if we take a machine check in user mode · 63f44d65
      Michael Ellerman authored
      For an MCE (Machine Check Exception) that hits while in user mode
      MSR(PR=1), print the task info to the console MCE error log. This may
      help to identify an application that triggered the MCE.
      
      After this patch the MCE console looks like:
      
        Severe Machine check interrupt [Recovered]
          NIP: [0000000010039778] PID: 762 Comm: ebizzy
          Initiator: CPU
          Error type: SLB [Multihit]
            Effective address: 0000000010039778
      
        Severe Machine check interrupt [Not recovered]
          NIP: [0000000010039778] PID: 763 Comm: ebizzy
          Initiator: CPU
          Error type: UE [Page table walk ifetch]
            Effective address: 0000000010039778
        ebizzy[763]: unhandled signal 7 at 0000000010039778 nip 0000000010039778 lr 0000000010001b44 code 30004
      Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      63f44d65
    • Mahesh Salgaonkar's avatar
      powerpc/book3s: Print the kernel function name in machine check · 5b1d6fc2
      Mahesh Salgaonkar authored
      For D-side errors we print the load/store address that caused the
      machine check as 'Effective address'. But the instruction that may have
      caused the machine check can also be helpful, so in addition to printing
      the NIP, also print the kernel function name as well.
      
      After this patch the MCE console log would look like:
      
        Severe Machine check interrupt [Recovered]
          NIP [d00000001bc70194]: init_module+0x194/0x2b0 [bork_kernel]
          Initiator: CPU
          Error type: SLB [Parity]
            Effective address: d000000026de0000
      Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      5b1d6fc2
  2. 01 Apr, 2017 5 commits
    • Aneesh Kumar K.V's avatar
      powerpc/mm: Enable mappings above 128TB · f4ea6dcb
      Aneesh Kumar K.V authored
      Not all user space application is ready to handle wide addresses. It's
      known that at least some JIT compilers use higher bits in pointers to
      encode their information. It collides with valid pointers with 512TB
      addresses and leads to crashes.
      
      To mitigate this, we are not going to allocate virtual address space
      above 128TB by default.
      
      But userspace can ask for allocation from full address space by
      specifying hint address (with or without MAP_FIXED) above 128TB.
      
      If hint address set above 128TB, but MAP_FIXED is not specified, we try
      to look for unmapped area by specified address. If it's already
      occupied, we look for unmapped area in *full* address space, rather than
      from 128TB window.
      
      This approach helps to easily make application's memory allocator aware
      about large address space without manually tracking allocated virtual
      address space.
      
      This is going to be a per mmap decision. ie, we can have some mmaps with
      larger addresses and other that do not.
      
      A sample memory layout looks like:
      
        10000000-10010000 r-xp 00000000 fc:00 9057045          /home/max_addr_512TB
        10010000-10020000 r--p 00000000 fc:00 9057045          /home/max_addr_512TB
        10020000-10030000 rw-p 00010000 fc:00 9057045          /home/max_addr_512TB
        10029630000-10029660000 rw-p 00000000 00:00 0          [heap]
        7fff834a0000-7fff834b0000 rw-p 00000000 00:00 0
        7fff834b0000-7fff83670000 r-xp 00000000 fc:00 9177190  /lib/powerpc64le-linux-gnu/libc-2.23.so
        7fff83670000-7fff83680000 r--p 001b0000 fc:00 9177190  /lib/powerpc64le-linux-gnu/libc-2.23.so
        7fff83680000-7fff83690000 rw-p 001c0000 fc:00 9177190  /lib/powerpc64le-linux-gnu/libc-2.23.so
        7fff83690000-7fff836a0000 rw-p 00000000 00:00 0
        7fff836a0000-7fff836c0000 r-xp 00000000 00:00 0        [vdso]
        7fff836c0000-7fff83700000 r-xp 00000000 fc:00 9177193  /lib/powerpc64le-linux-gnu/ld-2.23.so
        7fff83700000-7fff83710000 r--p 00030000 fc:00 9177193  /lib/powerpc64le-linux-gnu/ld-2.23.so
        7fff83710000-7fff83720000 rw-p 00040000 fc:00 9177193  /lib/powerpc64le-linux-gnu/ld-2.23.so
        7fffdccf0000-7fffdcd20000 rw-p 00000000 00:00 0        [stack]
        1000000000000-1000000010000 rw-p 00000000 00:00 0
        1ffff83710000-1ffff83720000 rw-p 00000000 00:00 0
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f4ea6dcb
    • Aneesh Kumar K.V's avatar
    • Aneesh Kumar K.V's avatar
      powerpc/pseries: Skip using reserved virtual address range · 82228e36
      Aneesh Kumar K.V authored
      Now that we use all the available virtual address range, we need to make
      sure we don't generate VSID such that it overlaps with the reserved vsid
      range. Reserved vsid range include the virtual address range used by the
      adjunct partition and also the VRMA virtual segment. We find the context
      value that can result in generating such a VSID and reserve it early in
      boot.
      
      We don't look at the adjunct range, because for now we disable the
      adjunct usage in a Linux LPAR via CAS interface.
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      [mpe: Rewrite hash__reserve_context_id(), move the rest into pseries]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      82228e36
    • Aneesh Kumar K.V's avatar
      powerpc/mm/hash: Store addr_limit in PACA · bb183221
      Aneesh Kumar K.V authored
      We optmize the slice page size array copy to paca by copying only the
      range based on addr_limit. This will require us to not look at page size
      array beyond addr_limit in PACA on slb fault. To enable that copy task
      size to paca which will be used during slb fault.
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      [mpe: Rename from task_size to addr_limit, consolidate #ifdefs]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      bb183221
    • Aneesh Kumar K.V's avatar
      powerpc/mm: Add addr_limit to mm_context and use it to derive max slice index · 957b778a
      Aneesh Kumar K.V authored
      In the followup patch, we will increase the slice array size to handle
      512TB range, but will limit the max addr to 128TB. Avoid doing
      unnecessary computation and avoid doing slice mask related operation
      above address limit.
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      957b778a
  3. 31 Mar, 2017 28 commits
  4. 28 Mar, 2017 1 commit
  5. 27 Mar, 2017 3 commits