1. 03 6月, 2018 1 次提交
    • C
      powerpc/Makefile: set -mcpu=860 flag for the 8xx · 1c389763
      Christophe Leroy 提交于
      When compiled with GCC 8.1, vmlinux is significantly bigger than
      with GCC 4.8.
      
      When looking at the generated code with objdump, we notice that
      all functions and loops when a 16 bytes alignment. This significantly
      increases the size of the kernel. It is pointless and even
      counterproductive as on the 8xx 'nop' also consumes one clock cycle.
      
      Size of vmlinux with GCC 4.8:
         text	   data	    bss	    dec	    hex	filename
      5801948	1626076	 457796	7885820	 7853fc	vmlinux
      
      Size of vmlinux with GCC 8.1:
         text	   data	    bss	    dec	    hex	filename
      6764592	1630652	 456476	8851720	 871108	vmlinux
      
      Size of vmlinux with GCC 8.1 and this patch:
         text	   data	    bss	    dec	    hex	filename
      6331544	1631756	 456476	8419776	 8079c0	vmlinux
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1c389763
  2. 01 6月, 2018 3 次提交
  3. 01 4月, 2018 2 次提交
  4. 31 3月, 2018 2 次提交
  5. 06 3月, 2018 1 次提交
  6. 11 12月, 2017 1 次提交
    • A
      powerpc/modules: Fix alignment of .toc section in kernel modules · 5c45b528
      Alan Modra 提交于
      powerpc64 gcc can generate code that offsets an address, to access
      part of an object in memory. If the address is a -mcmodel=medium toc
      pointer relative address then code like the following is possible.
      
        addis r9,r2,var@toc@ha
        ld r3,var@toc@l(r9)
        ld r4,(var+8)@toc@l(r9)
      
      This works fine so long as var is naturally aligned, *and* r2 is
      sufficiently aligned. If not, there is a possibility that the offset
      added to access var+8 wraps over a n*64k+32k boundary. Modules don't
      have any guarantee that r2 is sufficiently aligned. Moreover, code
      generated by older compilers generates a .toc section with 2**0
      alignment, which can result in relocation failures at module load time
      even without the wrap problem.
      
      Thus, this patch links modules with an aligned .toc section (Makefile
      and module.lds changes), and forces alignment for out of tree modules
      or those without a .toc section (module_64.c changes).
      Signed-off-by: NAlan Modra <amodra@gmail.com>
      [desnesn: updated patch to apply to powerpc-next kernel v4.15 ]
      Signed-off-by: NDesnes A. Nunes do Rosario <desnesn@linux.vnet.ibm.com>
      [mpe: Fix out-of-tree build, swap -256 for ~0xff, reflow comment]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5c45b528
  7. 10 8月, 2017 1 次提交
  8. 31 7月, 2017 1 次提交
  9. 26 7月, 2017 1 次提交
    • M
      powerpc/Makefile: Fix ld version check with 64-bit LE-only toolchain · b40b2386
      Michael Ellerman 提交于
      In commit efe0160c ("powerpc/64: Linker on-demand sfpr functions
      for modules"), we added an ld version check early in the powerpc
      top-level Makefile.
      
      Because the Makefile runs before the kernel config is setup, the
      checks for CONFIG_CPU_LITTLE_ENDIAN etc. all take the default case. So
      we end up configuring ld for 32-bit big endian.
      
      That would be OK, except that for historical (or perhaps no) reason,
      we use 'override LD' to add the endian flags to the LD variable
      itself, rather than the normal approach of adding them to LDFLAGS.
      
      The end result is that when we check the ld version we run it as:
      
        $(CROSS_COMPILE)ld -EB -m elf32ppc --version
      
      This often works, unless you are using a 64-bit only and/or little
      endian only, toolchain. In which case you see something like:
      
        $ make defconfig
        powerpc64le-linux-ld: unrecognised emulation mode: elf32ppc
        Supported emulations: elf64lppc elf32lppc elf32lppclinux elf32lppcsim
        /bin/sh: 1: [: -ge: unexpected operator
      
      The proper fix is to stop using 'override LD', but that will require a
      fair bit of testing. Instead we can fix it for now just by reordering
      the Makefile to do the version check earlier.
      
      Fixes: efe0160c ("powerpc/64: Linker on-demand sfpr functions for modules")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b40b2386
  10. 30 5月, 2017 2 次提交
  11. 28 4月, 2017 2 次提交
  12. 03 3月, 2017 1 次提交
  13. 30 11月, 2016 1 次提交
  14. 29 11月, 2016 1 次提交
    • M
      powerpc: Stop passing ARCH=ppc64 to boot Makefile · 1196d7aa
      Michael Ellerman 提交于
      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: NMichael Ellerman <mpe@ellerman.id.au>
      1196d7aa
  15. 18 11月, 2016 1 次提交
  16. 14 11月, 2016 1 次提交
    • M
      powerpc/book3s64: Always build for power4 or later · 3a849815
      Michael Ellerman 提交于
      When we're not compiling for a specific CPU, ie. none of the
      CONFIG_POWERx_CPU options are set, and CONFIG_GENERIC_CPU *is* set, we
      currently don't pass any -mcpu option to the compiler. This means the
      compiler builds for a "generic" Power CPU.
      
      But back in 2014 we dropped support for pre power4 CPUs in commit
      468a3302 ("powerpc: Drop support for pre-POWER4 cpus").
      
      Given that, there's no point in building the kernel to run on pre power4
      cpus. So update the flags we pass to the compiler when
      CONFIG_GENERIC_CPU is set, to specify -mcpu=power4.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      3a849815
  17. 25 9月, 2016 1 次提交
  18. 13 9月, 2016 3 次提交
  19. 10 8月, 2016 1 次提交
    • M
      powerpc/Makefile: Use cflags-y/aflags-y for setting endian options · 164af597
      Michael Ellerman 提交于
      When we introduced the little endian support, we added the endian flags
      to CC directly using override. I don't know the history of why we did
      that, I suspect no one does.
      
      Although this mostly works, it has one bug, which is that CROSS32CC
      doesn't get -mbig-endian. That means when the compiler is little endian
      by default and the user is building big endian, vdso32 is incorrectly
      compiled as little endian and the kernel fails to build.
      
      Instead we can add the endian flags to cflags-y/aflags-y, and then
      append those to KBUILD_CFLAGS/KBUILD_AFLAGS.
      
      This has the advantage of being 1) less ugly, 2) the documented way of
      adding flags in the arch Makefile and 3) it fixes building vdso32 with a
      LE toolchain.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      164af597
  20. 14 7月, 2016 1 次提交
  21. 05 7月, 2016 1 次提交
  22. 12 3月, 2016 1 次提交
  23. 07 3月, 2016 1 次提交
    • T
      powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel · 8c50b72a
      Torsten Duwe 提交于
      Firstly we add logic to Kconfig to allow a user to choose if they want
      mprofile-kernel. This has to be user-selectable because only some
      current toolchains support it. If we enabled it unconditionally we would
      prevent some users from building the kernel entirely.
      
      Arguably it would be nice if we could detect if mprofile-kernel was
      available, and use it then. However that would violate the principle of
      least surprise because a user having choosen options such as live
      patching, would then see them quietly disabled at build time.
      
      We also make the user selectable option negative, ie. it disables when
      selected, so that allyesconfig continues to build on old toolchains.
      
      Once we've decided we do want to use mprofile-kernel, we then add a
      script which checks it actually works. That is because there are
      versions of gcc that accept the flag but don't generate correct code.
      
      Due to the way kconfig works, we can't error out when we detect a
      non-working toolchain. If we did a user would never be able to modify
      their config and run oldconfig - because the check would block oldconfig
      from running. Instead we emit a warning and add a bogus flag to CFLAGS
      so that the build will fail.
      Signed-off-by: NTorsten Duwe <duwe@suse.de>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      8c50b72a
  24. 19 10月, 2015 1 次提交
    • M
      powerpc/cell: Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU · bed08b7e
      Michael Ellerman 提交于
      The TUNE_CELL option allows you to build a kernel that runs on multiple
      CPUs but is tuned (ie. optimised) to run on Cell CPUs. Now days no one
      is building a distro in that fashion, and any users who are building
      custom kernels for their Cell machines are better off building with
      CONFIG_CELL_CPU, which builds a kernel that only runs on Cell and
      therefore can be optimised even more aggresively.
      
      Dropping the option also avoids confusing other users, who are presented
      with an option to tune for Cell when they are not building for a Cell
      CPU at all.
      Suggested-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bed08b7e
  25. 01 10月, 2015 1 次提交
  26. 04 9月, 2015 1 次提交
  27. 08 8月, 2015 1 次提交
    • S
      powerpc/85xx: Use kconfig fragments · 44d54014
      Scott Wood 提交于
      Unify mpc85xx and corenet configs using fragments, to ease maintenance
      and avoid the sort of drift that the previous patch fixed.
      
      Hardware and software options are separated, with the hope that other
      embedded platforms could share the software options, and to make it
      easier to maintain custom/alternate configs that focus on either
      hardware or software options.
      
      Due to the previous patch, this patch should not affect the results of
      any of the affected defconfigs -- only how those results are achieved.
      The resulting config is more or less the union of the options that any
      of the configs previously selected.  No attempt was made in this (or
      the previous) patch to edit out questionable options, but this patch
      will make it easier to do so in future patches.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      44d54014
  28. 11 6月, 2015 3 次提交
  29. 02 6月, 2015 1 次提交
    • C
      powerpc/configs: Replace pseries_le_defconfig with a Makefile target using merge_config · ea4d1a87
      Cyril Bur 提交于
      Rather than continuing to maintain a copy of pseries_defconfig with
      CONFIG_CPU_LITTLE_ENDIAN enabled, use the generic merge_config script
      and use an le.config to enable little endian on top of pseries_defconfig
      without the need for a duplicated _defconfig file.
      
      This method will require less maintenance in the future and will ensure
      that both 'defconfigs' are always in sync.
      
      It is worth noting that the seemingly more simple approach of:
      
        pseries_le_defconfig: pseries_defconfig
        	$(Q)$(MAKE) le.config
      
      Will not work when building using O=builddir.
      
      The obvious fix to that:
      
        pseries_le_defconfig:
        	$(Q)$(MAKE) -f $(srctree)/Makefile pseries_defconfig le.config
      
      Also does not work. This is because if we have for example:
      
      config FOO
      	depends on CPU_BIG_ENDIAN
      	select BAR
      
      Then BAR will be enabled by the first call to kconfig (via
      pseries_defconfig), and then will remain enabled after we merge
      le.config, even though FOO will have been turned off.
      
      The solution is to ensure to only invoke the kconfig logic once, after
      we have merged all the config fragments. This ensures nothing is
      select'ed on that should then be disabled by the later merged configs.
      This is done through the explicit call to make olddefconfig
      Signed-off-by: NCyril Bur <cyrilbur@gmail.com>
      Reviewed-by: NSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
      [mpe: Massage change log, fix white space and use ARCH not SRCARCH]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ea4d1a87
  30. 11 5月, 2015 1 次提交
    • M
      powerpc: Reject binutils 2.24 when building little endian · 60e065f7
      Michael Ellerman 提交于
      There is a bug in binutils 2.24 which causes miscompilation if we're
      building little endian and using weak symbols (which the kernel does).
      
      It is fixed in binutils commit 57fa7b8c7e59 "Correct elf_merge_st_other
      arguments for weak symbols", which is in binutils 2.25 and has been
      backported to the binutils 2.24 branch and has been picked up by most
      distros it seems.
      
      However if we're running stock 2.24 (no extra version) then the bug is
      present, so check for that and bail.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      60e065f7