1. 09 5月, 2017 4 次提交
    • N
      powerpc: Don't print cpu_spec->cpu_name if it's NULL · 75bda950
      Nicholas Piggin 提交于
      Currently we assume that if the cpu_spec has a pvr_mask then it must also have a
      cpu_name. But that will change in a subsequent commit when we do CPU feature
      discovery via the device tree, so check explicitly if cpu_name is NULL.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      75bda950
    • 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
    • M
      powerpc/mm/book3s/64: Rework page table geometry for lower memory usage · ba95b5d0
      Michael Ellerman 提交于
      Recently in commit f6eedbba ("powerpc/mm/hash: Increase VA range to 128TB")
      we increased the virtual address space for user processes to 128TB by default,
      and up to 512TB if user space opts in.
      
      This obviously required expanding the range of the Linux page tables. For Book3s
      64-bit using hash and with PAGE_SIZE=64K, we increased the PGD to 2^15 entries.
      This meant we could cover the full address range, while still being able to
      insert a 16G hugepage at the PGD level and a 16M hugepage in the PMD.
      
      The downside of that geometry is that it uses a lot of memory for the PGD, and
      in particular makes the PGD a 4-page allocation, which means it's much more
      likely to fail under memory pressure.
      
      Instead we can make the PMD larger, so that a single PUD entry maps 16G,
      allowing the 16G hugepages to sit at that level in the tree. We're then able to
      split the remaining bits between the PUG and PGD. We make the PGD slightly
      larger as that results in lower memory usage for typical programs.
      
      When THP is enabled the PMD actually doubles in size, to 2^11 entries, or 2^14
      bytes, which is large but still < PAGE_SIZE.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: NBalbir Singh <bsingharora@gmail.com>
      Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      ba95b5d0
    • H
      powerpc: Fix distclean with Makefile.postlink · 24e0bfbf
      Horia Geantă 提交于
      Makefile.postlink always includes include/config/auto.conf, however
      this file is not present in a clean kernel tree, causing make to fail:
      
        $ git clone linuxppc.git
        $ cd linuxppc.git
        $ make distclean
        arch/powerpc/Makefile.postlink:10: include/config/auto.conf: No such file or directory
        make[1]: *** No rule to make target `include/config/auto.conf'.  Stop.
        make: *** [vmlinuxclean] Error 2
      
      Equally running 'make distclean; make distclean' will trip the error case.
      
      Change the inclusion such that file not being found does not trigger an error.
      
      Fixes: f188d052 ("powerpc: Use the new post-link pass to check relocations")
      Reported-by: NMircea Pop <mircea.pop@nxp.com>
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Tested-by: NJustin M. Forbes <jforbes@fedoraproject.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      24e0bfbf
  2. 05 5月, 2017 1 次提交
    • S
      powerpc/64e: Don't place the stack beyond TASK_SIZE · 61baf155
      Scott Wood 提交于
      Commit f4ea6dcb ("powerpc/mm: Enable mappings above 128TB") increased
      the task size on book3s, and introduced a mechanism to dynamically
      control whether a task uses these larger addresses.  While the change to
      the task size itself was ifdef-protected to only apply on book3s, the
      change to STACK_TOP_USER64 was not.  On book3e, this had the effect of
      trying to use addresses up to 128TiB for the stack despite a 64TiB task
      size limit -- which broke 64-bit userspace producing the following errors:
      
      Starting init: /sbin/init exists but couldn't execute it (error -14)
      Starting init: /bin/sh exists but couldn't execute it (error -14)
      Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
      
      Fixes: f4ea6dcb ("powerpc/mm: Enable mappings above 128TB")
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NScott Wood <oss@buserror.net>
      61baf155
  3. 04 5月, 2017 1 次提交
  4. 03 5月, 2017 9 次提交
  5. 02 5月, 2017 2 次提交
  6. 01 5月, 2017 2 次提交
  7. 30 4月, 2017 1 次提交
    • L
      powerpc/64e: Fix hang when debugging programs with relocated kernel · fd615f69
      LiuHailong 提交于
      Debug interrupts can be taken during interrupt entry, since interrupt
      entry does not automatically turn them off.  The kernel will check
      whether the faulting instruction is between [interrupt_base_book3e,
      __end_interrupts], and if so clear MSR[DE] and return.
      
      However, when the kernel is built with CONFIG_RELOCATABLE, it can't use
      LOAD_REG_IMMEDIATE(r14,interrupt_base_book3e) and
      LOAD_REG_IMMEDIATE(r15,__end_interrupts), as they ignore relocation.
      Thus, if the kernel is actually running at a different address than it
      was built at, the address comparison will fail, and the exception entry
      code will hang at kernel_dbg_exc.
      
      r2(toc) is also not usable here, as r2 still holds data from the
      interrupted context, so LOAD_REG_ADDR() doesn't work either.  So we use
      the *name@got* to get the EV of two labels directly.
      
      Test programs test.c shows as follows:
      int main(int argc, char *argv[])
      {
      	if (access("/proc/sys/kernel/perf_event_paranoid", F_OK) == -1)
      		printf("Kernel doesn't have perf_event support\n");
      }
      
      Steps to reproduce the bug, for example:
       1) ./gdb ./test
       2) (gdb) b access
       3) (gdb) r
       4) (gdb) s
      Signed-off-by: NLiu Hailong <liu.hailong6@zte.com.cn>
      Signed-off-by: NJiang Xuexin <jiang.xuexin@zte.com.cn>
      Reviewed-by: NJiang Biao <jiang.biao2@zte.com.cn>
      Reviewed-by: NLiu Song <liu.song11@zte.com.cn>
      Reviewed-by: NHuang Jian <huang.jian@zte.com.cn>
      [scottwood: cleaned up commit message, and specified bad behavior
       as a hang rather than an oops to correspond to mainline kernel behavior]
      Fixes: 1cb6e064 ("powerpc/book3e: support CONFIG_RELOCATABLE")
      Cc: <stable@vger.kernel.org> # 4.4.x-
      Signed-off-by: NScott Wood <oss@buserror.net>
      fd615f69
  8. 28 4月, 2017 18 次提交
  9. 27 4月, 2017 2 次提交