From 5a77287012c36ca39549f2f745d6c3a2e2879ffa Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Thu, 6 Mar 2014 14:35:35 -0500 Subject: Add ppc64le support from Brent Baude (rhbz 1073102) --- Makefile.config | 9 ++++++++- config-powerpc64le | 3 +++ kernel.spec | 27 +++++++++++++++++++++++---- ppc64le_module_fix.patch | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 config-powerpc64le create mode 100644 ppc64le_module_fix.patch diff --git a/Makefile.config b/Makefile.config index 806c56766..348396828 100644 --- a/Makefile.config +++ b/Makefile.config @@ -12,7 +12,8 @@ CONFIGFILES = \ $(CFG)-armv7hl.config $(CFG)-armv7hl-lpae.config \ $(CFG)-aarch64.config \ $(CFG)-ppc.config $(CFG)-ppc-smp.config \ - $(CFG)-ppc64.config $(CFG)-ppc64p7.config $(CFG)-ppc64-debug.config + $(CFG)-ppc64.config $(CFG)-ppc64p7.config $(CFG)-ppc64-debug.config \ + $(CFG)-ppc64le.config PLATFORMS = x86 x86_64 powerpc powerpc32 powerpc64 s390x arm arm64 TEMPFILES = $(addprefix temp-, $(addsuffix -generic, $(PLATFORMS))) @@ -86,6 +87,9 @@ temp-powerpc32-generic: config-powerpc32-generic temp-powerpc-generic temp-powerpc64-generic: config-powerpc64 temp-powerpc-generic perl merge.pl $^ > $@ +temp-powerpc64le-generic: config-powerpc64le temp-powerpc64-generic + perl merge.pl $^ > $@ + temp-s390-generic: config-s390x temp-generic perl merge.pl $^ > $@ @@ -116,6 +120,9 @@ $(CFG)-ppc64-debug.config: temp-powerpc64-generic temp-powerpc-debug-generic $(CFG)-ppc64p7.config: config-powerpc64p7 temp-powerpc64-generic perl merge.pl $^ powerpc > $@ +$(CFG)-ppc64le.config: /dev/null temp-powerpc64le-generic + perl merge.pl $^ powerpc > $@ + $(CFG)-s390x.config: config-s390x temp-s390-generic perl merge.pl $^ s390 > $@ diff --git a/config-powerpc64le b/config-powerpc64le new file mode 100644 index 000000000..03cb3bdd8 --- /dev/null +++ b/config-powerpc64le @@ -0,0 +1,3 @@ +# CONFIG_VIRTUALIZATION is not set +# CONFIG_BPF_JIT is not set +CONFIG_CPU_LITTLE_ENDIAN=y diff --git a/kernel.spec b/kernel.spec index b662cf51d..86102a6c8 100644 --- a/kernel.spec +++ b/kernel.spec @@ -222,7 +222,7 @@ Summary: The Linux kernel %if %{with_vdso_install} # These arches install vdso/ directories. -%define vdso_arches %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x aarch64 +%define vdso_arches %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x aarch64 ppc64le %endif # Overrides for generic default options @@ -252,7 +252,7 @@ Summary: The Linux kernel %endif # sparse blows up on ppc64 and sparc64 -%ifarch ppc64 ppc ppc64p7 +%ifarch ppc64 ppc ppc64p7 ppc64le %define with_sparse 0 %endif @@ -284,6 +284,17 @@ Summary: The Linux kernel %define kernel_image_elf 1 %endif +%ifarch ppc64le +%define asmarch powerpc +%define hdrarch powerpc +%define all_arch_configs kernel-%{version}-ppc64le.config +%define image_install_path boot +%define make_target vmlinux +%define kernel_image vmlinux +%define kernel_image_elf 1 +%define with_tools 0 +%endif + %ifarch s390x %define asmarch s390 %define hdrarch s390 @@ -365,7 +376,7 @@ Summary: The Linux kernel %endif # Architectures we build tools/cpupower on -%define cpupowerarchs %{ix86} x86_64 ppc ppc64 ppc64p7 %{arm} aarch64 +%define cpupowerarchs %{ix86} x86_64 ppc ppc64 ppc64p7 %{arm} aarch64 ppc64le # # Packages that need to be installed before the kernel is, because the %%post @@ -406,7 +417,7 @@ Version: %{rpmversion} Release: %{pkg_release} # DO NOT CHANGE THE 'ExclusiveArch' LINE TO TEMPORARILY EXCLUDE AN ARCHITECTURE BUILD. # SET %%nobuildarches (ABOVE) INSTEAD -ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x %{arm} aarch64 +ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x %{arm} aarch64 ppc64le ExclusiveOS: Linux %kernel_reqprovconf @@ -473,6 +484,7 @@ Source51: config-powerpc32-generic Source52: config-powerpc32-smp Source53: config-powerpc64 Source54: config-powerpc64p7 +Source55: config-powerpc64le Source70: config-s390x @@ -637,6 +649,9 @@ Patch25034: bug-1071998.patch #rhbz 1051748 Patch25035: Bluetooth-allocate-static-minor-for-vhci.patch +#Fixes module loading on ppc64le +Patch25036: ppc64le_module_fix.patch + # END OF PATCH DEFINITIONS %endif @@ -1293,6 +1308,9 @@ ApplyPatch bug-1071998.patch #rhbz 1051748 ApplyPatch Bluetooth-allocate-static-minor-for-vhci.patch +# Fixes module loading on ppc64le +ApplyPatch ppc64le_module_fix.patch + # END OF PATCH APPLICATIONS %endif @@ -2073,6 +2091,7 @@ fi # || || %changelog * Thu Mar 06 2014 Josh Boyer +- Add ppc64le support from Brent Baude (rhbz 1073102) - Fix depmod error message from hci_vhci module (rhbz 1051748) - Fix bogus WARN in iwlwifi (rhbz 1071998) diff --git a/ppc64le_module_fix.patch b/ppc64le_module_fix.patch new file mode 100644 index 000000000..77e6f55eb --- /dev/null +++ b/ppc64le_module_fix.patch @@ -0,0 +1,35 @@ +From 414794ae6a59c38f6e5793ad50df97cba3dda4e3 Mon Sep 17 00:00:00 2001 +From: Tony Breeds +Date: Thu, 30 Jan 2014 19:58:55 +1100 +Subject: [PATCH] powerpc/le: Avoid creatng R_PPC64_TOCSAVE relocations for + modules. + +When building modules with a native le toolchain the linker will +generate R_PPC64_TOCSAVE relocations when it's safe to omit saving r2 on +a plt call. This isn't helpful in the conext of a kernel module and the +kernel will fail to load those modules with an error like: + nf_conntrack: Unknown ADD relocation: 109 + +This patch tells the linker to avoid createing R_PPC64_TOCSAVE +relocations allowing modules to load. + +Signed-off-by: Tony Breeds +--- + arch/powerpc/Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile +index 0f4344e..fff3945 100644 +--- a/arch/powerpc/Makefile ++++ b/arch/powerpc/Makefile +@@ -74,6 +74,9 @@ override CROSS32AS += -mlittle-endian + LDEMULATION := lppc + GNUTARGET := powerpcle + MULTIPLEWORD := -mno-multiple ++ifeq ($(call cc-option-yn,-mno-save-toc-indirect),y) ++ KBUILD_CFLAGS_MODULE += -mno-save-toc-indirect ++endif + else + ifeq ($(call cc-option-yn,-mbig-endian),y) + override CC += -mbig-endian +-- -- cgit