From 4f5d99cab4a3150e75a19827a882090afc651d33 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 6 Jul 2018 05:11:04 +0100 Subject: [PATCH] [powerpcspe] Fix build failures (thanks to James Clarke) --- debian/changelog | 3 ++ ...file-don-t-pull-in-quad.o-for-32-bit.patch | 28 +++++++++++++++ ...ib-sstep-fix-building-for-powerpcspe.patch | 35 +++++++++++++++++++ debian/patches/series | 2 ++ 4 files changed, 68 insertions(+) create mode 100644 debian/patches/bugfix/powerpc/powerpc-lib-makefile-don-t-pull-in-quad.o-for-32-bit.patch create mode 100644 debian/patches/bugfix/powerpc/powerpc-lib-sstep-fix-building-for-powerpcspe.patch diff --git a/debian/changelog b/debian/changelog index 7b71cfd57..a865197b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ linux (4.17.3-2) UNRELEASED; urgency=medium [ Ben Hutchings ] * linux-tools: Fix cross-build of objtool + * [powerpcspe] Fix build failures (thanks to James Clarke): + - powerpc/lib/sstep: Fix building for powerpcspe + - powerpc/lib/Makefile: Don't pull in quad.o for 32-bit kernels -- Sjoerd Simons Wed, 04 Jul 2018 10:25:57 +0200 diff --git a/debian/patches/bugfix/powerpc/powerpc-lib-makefile-don-t-pull-in-quad.o-for-32-bit.patch b/debian/patches/bugfix/powerpc/powerpc-lib-makefile-don-t-pull-in-quad.o-for-32-bit.patch new file mode 100644 index 000000000..f632e1415 --- /dev/null +++ b/debian/patches/bugfix/powerpc/powerpc-lib-makefile-don-t-pull-in-quad.o-for-32-bit.patch @@ -0,0 +1,28 @@ +From: James Clarke +Date: Sun, 18 Feb 2018 15:54:44 +0000 +Subject: powerpc/lib/Makefile: Don't pull in quad.o for 32-bit kernels +Origin: https://people.debian.org/~jrtc27/linux-ppc32/0002-powerpc-lib-Makefile-Don-t-pull-in-quad.o-for-32-bit.patch + +The functions exported by quad.o are only used when guarded by +__powerpc64__ and so are unused on 32-bit kernels. Moreover, their +implementations make use of instructions which will cause an illegal +instruction error on 32-bit processors, and are not accepted by the +assembler for SPE processors. + +Fixes: 31bfdb036f12 ("powerpc: Use instruction emulation infrastructure to handle alignment faults") +Signed-off-by: James Clarke +--- + arch/powerpc/lib/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/lib/Makefile ++++ b/arch/powerpc/lib/Makefile +@@ -34,7 +34,7 @@ obj64-$(CONFIG_KPROBES_SANITY_TEST) += t + + obj-y += checksum_$(BITS).o checksum_wrappers.o + +-obj-y += sstep.o ldstfp.o quad.o ++obj-y += sstep.o ldstfp.o + obj64-y += quad.o + + obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o diff --git a/debian/patches/bugfix/powerpc/powerpc-lib-sstep-fix-building-for-powerpcspe.patch b/debian/patches/bugfix/powerpc/powerpc-lib-sstep-fix-building-for-powerpcspe.patch new file mode 100644 index 000000000..dfe979c35 --- /dev/null +++ b/debian/patches/bugfix/powerpc/powerpc-lib-sstep-fix-building-for-powerpcspe.patch @@ -0,0 +1,35 @@ +From: James Clarke +Date: Thu, 7 Dec 2017 20:32:44 +0000 +Subject: powerpc/lib/sstep: Fix building for powerpcspe +Origin: https://people.debian.org/~jrtc27/linux-ppc32/0001-powerpc-lib-sstep-Fix-building-for-powerpcspe.patch + +On powerpcspe, ptesync is not a recognised instruction and so fails to +assemble. We don't expect to have to emulate an lwsync or a ptesync on a +32-bit kernel, so just ifdef them out, and catch any unexpected barrier +types. + +Fixes: 3cdfcbfd32b9 ("powerpc: Change analyse_instr so it doesn't modify *regs") +Signed-off-by: James Clarke +--- + arch/powerpc/lib/sstep.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/powerpc/lib/sstep.c ++++ b/arch/powerpc/lib/sstep.c +@@ -2671,12 +2671,16 @@ void emulate_update_regs(struct pt_regs + case BARRIER_EIEIO: + eieio(); + break; ++#ifdef __powerpc64__ + case BARRIER_LWSYNC: + asm volatile("lwsync" : : : "memory"); + break; + case BARRIER_PTESYNC: + asm volatile("ptesync" : : : "memory"); + break; ++#endif ++ default: ++ WARN_ON_ONCE(1); + } + break; + diff --git a/debian/patches/series b/debian/patches/series index 54a970a2a..385359f9c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -67,6 +67,8 @@ bugfix/x86/perf-tools-fix-unwind-build-on-i386.patch bugfix/sh/sh-boot-do-not-use-hyphen-in-exported-variable-name.patch bugfix/x86/mmap-remember-the-map_fixed-flag-as-vm_fixed.patch bugfix/x86/mmap-add-an-exception-to-the-stack-gap-for-hotspot-jvm.patch +bugfix/powerpc/powerpc-lib-sstep-fix-building-for-powerpcspe.patch +bugfix/powerpc/powerpc-lib-makefile-don-t-pull-in-quad.o-for-32-bit.patch # Arch features features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch