From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AD16EB64D9 for ; Sat, 17 Jun 2023 08:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346290AbjFQINO (ORCPT ); Sat, 17 Jun 2023 04:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232705AbjFQINN (ORCPT ); Sat, 17 Jun 2023 04:13:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB6BB2738 for ; Sat, 17 Jun 2023 01:13:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3099E6119F for ; Sat, 17 Jun 2023 08:13:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F23DC433C8; Sat, 17 Jun 2023 08:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686989591; bh=pYjMN7MLAaF923rVQNQqFgTG6l+hYvIhGjTCKgWuIIk=; h=Subject:To:Cc:From:Date:From; b=G9WkIfl/xCkbEOiTn9e93+lD8G5A5oUpwbbzkEyFjMqAgFnpX6ynsEDAwQJoRZsFC vG8TPmCe+kNXFVKQ12t+U4llVK1CxGUurPkUKh1WxcCJ9avfJgsh663AMcY8QXc9K1 kck9XebNsqOoRkq3B9v6HxkadPVmQcEXmTVqpD20= Subject: FAILED: patch "[PATCH] x86/purgatory: remove PGO flags" failed to apply to 4.19-stable tree To: ribalda@chromium.org, akpm@linux-foundation.org, aou@eecs.berkeley.edu, bhe@redhat.com, bp@alien8.de, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, dyoung@redhat.com, ebiederm@xmission.com, horms@kernel.org, hpa@zytor.com, mingo@redhat.com, mpe@ellerman.id.au, nathan@kernel.org, ndesaulniers@google.com, npiggin@gmail.com, palmer@dabbelt.com, palmer@rivosinc.com, paul.walmsley@sifive.com, prudo@redhat.com, rostedt@goodmis.org, stable@vger.kernel.org, tglx@linutronix.de, trix@redhat.com, zwisler@google.com Cc: From: Date: Sat, 17 Jun 2023 10:13:00 +0200 Message-ID: <2023061700-surplus-art-1fef@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 . 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 # git commit -s git send-email --to '' --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 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. Link: https://lkml.kernel.org/r/20230321-kexec_clang16-v7-2-b05c520b7296@chromium.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda Cc: Cc: Albert Ou Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: Eric W. Biederman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Michael Ellerman Cc: Nathan Chancellor Cc: Nicholas Piggin Cc: Nick Desaulniers Cc: Palmer Dabbelt Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Philipp Rudo Cc: Ross Zwisler Cc: Simon Horman Cc: Steven Rostedt (Google) Cc: Thomas Gleixner Cc: Tom Rix Signed-off-by: Andrew Morton diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index 82fec66d46d2..42abd6af1198 100644 --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile @@ -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