]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up purgatory patches in 5.4
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 18:51:46 +0000 (20:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 18:51:46 +0000 (20:51 +0200)
queue-5.4/series
queue-5.4/x86-purgatory-fail-the-build-if-purgatory.ro-has-mis.patch [deleted file]
queue-5.4/x86-purgatory-remove-pgo-flags.patch

index 4711d2b290777a9645e38824a5b3d36b81fff66a..8a3d0a78e2c3bfc4910dea91e0e927dda9ecf7ab 100644 (file)
@@ -1,7 +1,6 @@
 nilfs2-reject-devices-with-insufficient-block-count.patch
-x86-purgatory-fail-the-build-if-purgatory.ro-has-mis.patch
-x86-purgatory-remove-pgo-flags.patch
 mm-rewrite-wait_on_page_bit_common-logic.patch
 list-add-list_del_init_careful-to-go-with-list_empty.patch
 epoll-ep_autoremove_wake_function-should-use-list_de.patch
 tracing-add-tracing_reset_all_online_cpus_unlocked-function.patch
+x86-purgatory-remove-pgo-flags.patch
diff --git a/queue-5.4/x86-purgatory-fail-the-build-if-purgatory.ro-has-mis.patch b/queue-5.4/x86-purgatory-fail-the-build-if-purgatory.ro-has-mis.patch
deleted file mode 100644 (file)
index 1dcc1d6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-From 73080c3a50981d969859bdbc1c85d079e59458b0 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 17 Mar 2020 14:08:41 +0100
-Subject: x86/purgatory: Fail the build if purgatory.ro has missing symbols
-
-From: Hans de Goede <hdegoede@redhat.com>
-
-[ Upstream commit e4160b2e4b02377c67f8ecd05786811598f39acd ]
-
-Linking purgatory.ro with -r enables "incremental linking"; this means
-no checks for unresolved symbols are done while linking purgatory.ro.
-
-A change to the sha256 code has caused the purgatory in 5.4-rc1 to have
-a missing symbol on memzero_explicit(), yet things still happily build.
-
-Add an extra check for unresolved symbols by calling ld without -r
-before running bin2c to generate kexec-purgatory.c.
-
-This causes a build of 5.4-rc1 with this patch added to fail as it should:
-
-    CHK     arch/x86/purgatory/purgatory.ro
-  ld: arch/x86/purgatory/purgatory.ro: in function `sha256_transform':
-  sha256.c:(.text+0x1c0c): undefined reference to `memzero_explicit'
-  make[2]: *** [arch/x86/purgatory/Makefile:72:
-      arch/x86/purgatory/kexec-purgatory.c] Error 1
-  make[1]: *** [scripts/Makefile.build:509: arch/x86/purgatory] Error 2
-  make: *** [Makefile:1650: arch/x86] Error 2
-
-Also remove --no-undefined from LDFLAGS_purgatory.ro as that has no
-effect.
-
-Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-Signed-off-by: Borislav Petkov <bp@suse.de>
-Link: https://lkml.kernel.org/r/20200317130841.290418-2-hdegoede@redhat.com
-Stable-dep-of: 97b6b9cbba40 ("x86/purgatory: remove PGO flags")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/x86/purgatory/.gitignore |  1 +
- arch/x86/purgatory/Makefile   | 13 ++++++++++---
- 2 files changed, 11 insertions(+), 3 deletions(-)
- create mode 100644 arch/x86/purgatory/.gitignore
-
-diff --git a/arch/x86/purgatory/.gitignore b/arch/x86/purgatory/.gitignore
-new file mode 100644
-index 0000000000000..d2be1500671de
---- /dev/null
-+++ b/arch/x86/purgatory/.gitignore
-@@ -0,0 +1 @@
-+purgatory.chk
-diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile
-index 969d2b2eb7d71..d0f628601d47a 100644
---- a/arch/x86/purgatory/Makefile
-+++ b/arch/x86/purgatory/Makefile
-@@ -14,8 +14,12 @@ $(obj)/sha256.o: $(srctree)/lib/crypto/sha256.c FORCE
- CFLAGS_sha256.o := -D__DISABLE_EXPORTS
--LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib
--targets += purgatory.ro
-+# When linking purgatory.ro with -r unresolved symbols are not checked,
-+# also link a purgatory.chk binary without -r to check for unresolved symbols.
-+PURGATORY_LDFLAGS := -e purgatory_start -nostdlib -z nodefaultlib
-+LDFLAGS_purgatory.ro := -r $(PURGATORY_LDFLAGS)
-+LDFLAGS_purgatory.chk := $(PURGATORY_LDFLAGS)
-+targets += purgatory.ro purgatory.chk
- # Sanitizer, etc. runtimes are unavailable and cannot be linked here.
- GCOV_PROFILE  := n
-@@ -64,12 +68,15 @@ AFLAGS_REMOVE_entry64.o                    += -g -Wa,-gdwarf-2
- $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
-               $(call if_changed,ld)
-+$(obj)/purgatory.chk: $(obj)/purgatory.ro FORCE
-+              $(call if_changed,ld)
-+
- targets += kexec-purgatory.c
- quiet_cmd_bin2c = BIN2C   $@
-       cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@
--$(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE
-+$(obj)/kexec-purgatory.c: $(obj)/purgatory.ro $(obj)/purgatory.chk FORCE
-       $(call if_changed,bin2c)
- obj-$(CONFIG_KEXEC_FILE)      += kexec-purgatory.o
--- 
-2.39.2
-
index adea58d5ab8f9dd56b1f501baa5661654284f3ab..d4c3f8b22ad0f92aebdcd941f8285b0972649ada 100644 (file)
@@ -1,11 +1,11 @@
-From 5a54fd54f9738e184364b5467ebd072bc48f4ab0 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
+From 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda <ribalda@chromium.org>
 Date: Fri, 19 May 2023 16:47:37 +0200
 Subject: x86/purgatory: remove PGO flags
 
 From: Ricardo Ribalda <ribalda@chromium.org>
 
-[ Upstream commit 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e ]
+commit 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e upstream.
 
 If profile-guided optimization is enabled, the purgatory ends up with
 multiple .text sections.  This is not supported by kexec and crashes the
@@ -38,16 +38,15 @@ Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
 Cc: Thomas Gleixner <tglx@linutronix.de>
 Cc: Tom Rix <trix@redhat.com>
 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- arch/x86/purgatory/Makefile | 5 +++++
+ arch/x86/purgatory/Makefile |    5 +++++
  1 file changed, 5 insertions(+)
 
-diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile
-index d0f628601d47a..4db1940f81081 100644
 --- a/arch/x86/purgatory/Makefile
 +++ b/arch/x86/purgatory/Makefile
-@@ -14,6 +14,11 @@ $(obj)/sha256.o: $(srctree)/lib/crypto/sha256.c FORCE
+@@ -14,6 +14,11 @@ $(obj)/sha256.o: $(srctree)/lib/crypto/s
  
  CFLAGS_sha256.o := -D__DISABLE_EXPORTS
  
@@ -56,9 +55,6 @@ index d0f628601d47a..4db1940f81081 100644
 +# optimization flags.
 +KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%,$(KBUILD_CFLAGS))
 +
- # When linking purgatory.ro with -r unresolved symbols are not checked,
- # also link a purgatory.chk binary without -r to check for unresolved symbols.
- PURGATORY_LDFLAGS := -e purgatory_start -nostdlib -z nodefaultlib
--- 
-2.39.2
-
+ LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib
+ targets += purgatory.ro