Skip to contentSkip to conversation

FAILED: patch "[PATCH] x86/purgatory: remove PGO flags" failed to apply to 4.19-stable tree

PATCH In review [email protected] 2 participants 3 messages Jun 17, 2023 – Jun 21, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023061700-surplus-art-1fef@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e Mon Sep 17 00:00:00 2001
From: Ricardo Ribalda <[email protected]>
Date: Fri, 19 May 2023 16:47:37 +0200
Subject: [PATCH] x86/purgatory: remove PGO flags

If profile-guided optimization is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system.

Fixes 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory")
Cc Albert Ou <[email protected]>
Cc Baoquan He <[email protected]>
Cc Borislav Petkov (AMD) <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Dave Young <[email protected]>
Cc Eric W. Biederman <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Philipp Rudo <[email protected]>
Cc Ross Zwisler <[email protected]>
Cc Simon Horman <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tom Rix <[email protected]>
arch/x86/purgatory/Makefile +5 -0
index 82fec66d46d2..42abd6af1198 100644
@@ -14,6 +14,11 @@ $(obj)/sha256.o: $(srctree)/lib/crypto/sha256.c FORCE
 
 CFLAGS_sha256.o := -D__DISABLE_EXPORTS
 
+# When profile-guided optimization is enabled, llvm emits two different
+# overlapping text sections, which is not supported by kexec. Remove profile
+# 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 -z nodefaultlib
#1 lore raw

PATCH 1/1 x86/purgatory: remove PGO flags

If profile-guided optimization is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system.

Fixes 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory")
Cc Albert Ou <[email protected]>
Cc Baoquan He <[email protected]>
Cc Borislav Petkov (AMD) <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Dave Young <[email protected]>
Cc Eric W. Biederman <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Philipp Rudo <[email protected]>
Cc Ross Zwisler <[email protected]>
Cc Simon Horman <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tom Rix <[email protected]>
(cherry picked from commit 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e)
---
 arch/x86/purgatory/Makefile | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/purgatory/Makefile +5 -0
index 002f7a01af11..00f104e341e5 100644
@@ -12,6 +12,11 @@ $(obj)/string.o: $(srctree)/arch/x86/boot/compressed/string.c FORCE
 $(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
 	$(call if_changed_rule,cc_o_c)
 
+# When profile-guided optimization is enabled, llvm emits two different
+# overlapping text sections, which is not supported by kexec. Remove profile
+# optimization flags.
+KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%,$(KBUILD_CFLAGS))
+
 LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib
 targets += purgatory.ro
 
Signature · 1 line
2.41.0.162.gfafddb0af9-goog
author maintainer
#2 lore raw

Re: [PATCH 4.19.y] x86/purgatory: remove PGO flags

Quoted 33 lines · Ricardo Ribalda

If profile-guided optimization is enabled, the purgatory ends up with multiple .text sections. This is not supported by kexec and crashes the system.

Fixes 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory")
Cc Albert Ou <[email protected]>
Cc Baoquan He <[email protected]>
Cc Borislav Petkov (AMD) <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Dave Young <[email protected]>
Cc Eric W. Biederman <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Philipp Rudo <[email protected]>
Cc Ross Zwisler <[email protected]>
Cc Simon Horman <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tom Rix <[email protected]>
(cherry picked from commit 97b6b9cbba40a21c1d9a344d5c1991f8cfbf136e)
Quoted 4 lines
---
 arch/x86/purgatory/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

Now queued up, thanks.

greg k-h