1. 05 Dec, 2016 1 commit
    • Nicholas Piggin's avatar
      powerpc/boot: Request no dynamic linker for boot wrapper · ff45000f
      Nicholas Piggin authored
      The boot wrapper performs its own relocations and does not require
      PT_INTERP segment. However currently we don't tell the linker that.
      
      Prior to binutils 2.28 that works OK. But since binutils commit
      1a9ccd70f9a7 ("Fix the linker so that it will not silently generate ELF
      binaries with invalid program headers. Fix readelf to report such
      invalid binaries.") binutils tries to create a program header segment
      due to PT_INTERP, and the link fails because there is no space for it:
      
        ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
        ld: final link failed: Bad value
      
      So tell the linker not to do that, by passing --no-dynamic-linker.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      [mpe: Drop dependency on ld-version.sh and massage change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      ff45000f
  2. 03 Dec, 2016 1 commit
    • Libin's avatar
      powerpc/ftrace: Fix the comments for ftrace_modify_code · c02e0349
      Libin authored
      There is no need to worry about module and __init text disappearing
      case, because that ftrace has a module notifier that is called when a
      module is being unloaded and before the text goes away and this code
      grabs the ftrace_lock mutex and removes the module functions from the
      ftrace list, such that it will no longer do any modifications to that
      module's text, the update to make functions be traced or not is done
      under the ftrace_lock mutex as well. And by now, __init section codes
      should not been modified by ftrace, because it is black listed in
      recordmcount.c and ignored by ftrace.
      Suggested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarLi Bin <huawei.libin@huawei.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      c02e0349
  3. 02 Dec, 2016 13 commits
  4. 01 Dec, 2016 4 commits
    • Michael Ellerman's avatar
      powerpc: Make selects of IBM_EMAC_* depend on IBM_EMAC · 33596727
      Michael Ellerman authored
      We have a bunch of Kconfig symbols which select various IBM_EMAC_*
      symbols. These all cause warnings when IBM_EMAC is not selected.
      
      eg.
      
        warning: (PPC_CELL_NATIVE && BLUESTONE && CANYONLANDS && GLACIER &&
        EIGER && 440EPX && 440GRX && 440GX && 460SX && 405EX) selects
        IBM_EMAC_RGMII which has unmet direct dependencies (NETDEVICES &&
        ETHERNET && NET_VENDOR_IBM)
      
      So make them all depend on IBM_EMAC being enabled first.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      33596727
    • Michael Ellerman's avatar
      powerpc/cell: Drop select of MEMORY_HOTPLUG · 577ec789
      Michael Ellerman authored
      SPU_FS selects MEMORY_HOTPLUG, which is problematic because
      MEMORY_HOTPLUG is user selectable, meaning we can end up with a broken
      .config where MEMORY_HOTPLUG is enabled but its dependencies are not,
      leading to build breakages.
      
      The select of MEMORY_HOTPLUG for SPU_FS was added back in 2006, in
      commit 4da30d15 ("[POWERPC] spufs: fix memory hotplug dependency").
      
      However we reworked the spufs code and removed the dependency on memory
      hotplug in 2007 in commit 78bde53e ("[POWERPC] spufs: remove need
      for struct page for SPEs").
      
      So drop the select as it's no longer needed and causes problems.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      577ec789
    • Nathan Fontenot's avatar
      powerpc/pseries: Use lmb_is_removable() to check removability · 2db029ef
      Nathan Fontenot authored
      We should be using lmb_is_removable() to validate that enough LMBs
      are available to remove when doing a remove by count. This will check
      that the LMB is owned by the system and it is considered removable.
      This patch also adds a pr_info() notification to report the LMB count
      to remove was not satisfied.
      
      What we do now is just check that there are enough LMBs owned by the
      system when validating there are enough LMBs to remove. This can
      lead to situations where there are enough LMBs owned by the system
      but not enough that are considered removable. This results in having
      to bail out of the remove operation instead of just failing the request
      that we should have known wouldn't succeed.
      Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      2db029ef
    • Michael Ellerman's avatar
      powerpc/mm: Fix page table dump build on non-Book3S · dd5ac03e
      Michael Ellerman authored
      In the recent commit 1515ab93 ("powerpc/mm: Dump hash table") we
      added code to dump the hage page table. Currently this can be selected
      to build on any platform. However it breaks the build if we're building
      for a non-Book3S platform, because none of the hash page table related
      defines and so on exist. So restrict it to building only on Book3S.
      
      Similarly in commit 8eb07b18 ("powerpc/mm: Dump linux pagetables")
      we added code to dump the Linux page tables, which uses some constants
      which are only defined on Book3S - so guard those with an #ifdef.
      
      Fixes: 1515ab93 ("powerpc/mm: Dump hash table")
      Fixes: 8eb07b18 ("powerpc/mm: Dump linux pagetables")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      dd5ac03e
  5. 30 Nov, 2016 13 commits
  6. 29 Nov, 2016 3 commits
    • Michael Ellerman's avatar
      powerpc/boot: Fix rebuild when changing kernel endian · f0f7fe1a
      Michael Ellerman authored
      Now that we don't set ARCH incorrectly when calling the boot Makefile,
      we can use the generic cpp_lds_S rule for converting our zImage.lds.S
      into zImage.lds.
      
      The main advantage of using the generic rule is that it correctly uses
      if_changed, which means we correctly regenerate the linker script when
      switching endian. Fixing that means we are finally able to build one
      endian and then rebuild the other endian without requiring to clean
      between builds.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f0f7fe1a
    • Michael Ellerman's avatar
      powerpc/boot: All uses of if_changed should depend on FORCE · 42d0c932
      Michael Ellerman authored
      If we're using if_changed then we must depend on FORCE, so that
      if_changed gets a chance to check if something changed.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      42d0c932
    • Michael Ellerman's avatar
      powerpc: Stop passing ARCH=ppc64 to boot Makefile · 1196d7aa
      Michael Ellerman authored
      Back in 2005 when the ppc/ppc64 merge started, we used to build the
      kernel code in arch/powerpc but use the boot code from arch/ppc or
      arch/ppc64 depending on whether we were building for 32 or 64-bit.
      
      Originally we called the boot Makefile passing ARCH=$(OLDARCH), where
      OLDARCH was ppc or ppc64.
      
      In commit 20f62954 ("powerpc: Make building the boot image work for
      both 32-bit and 64-bit") (2005-10-11) we split the call for 32/64-bit
      using an ifeq check, because the two Makefiles took different targets,
      and explicitly passed ARCH=ppc64 for the 64-bit case and ARCH=ppc for
      the 32-bit case.
      
      Then in commit 94b212c2 ("powerpc: Move ppc64 boot wrapper code over
      to arch/powerpc") (2005-11-16) we moved the boot code into arch/powerpc
      and dropped the ppc case, but kept passing ARCH=ppc64 to
      arch/powerpc/boot/Makefile.
      
      Since then there have been several more boot targets added, all of which
      have copied the ARCH=ppc64 setting, such that now we have four targets
      using it.
      
      Currently it seems that nothing actually uses the ARCH value, but that's
      basically just luck, and in particular it prevents us from using the
      generic cpp_lds_S rule. It's also clearly wrong, ARCH=ppc64 is dead,
      buried and cremated.
      
      Fix it by dropping the setting of ARCH completely, the correct value is
      exported by the top level Makefile.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      1196d7aa
  7. 28 Nov, 2016 5 commits