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 6EB2DEB64D9 for ; Sat, 17 Jun 2023 08:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346299AbjFQIN3 (ORCPT ); Sat, 17 Jun 2023 04:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346293AbjFQIN2 (ORCPT ); Sat, 17 Jun 2023 04:13:28 -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 1D6811FF6 for ; Sat, 17 Jun 2023 01:13:27 -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 A9860611A9 for ; Sat, 17 Jun 2023 08:13:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED01C433C0; Sat, 17 Jun 2023 08:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686989606; bh=R7o8hu2I3nDBn3OYu9cYukXsQ/Xyo6iS7OWnLHqu/Ac=; h=Subject:To:Cc:From:Date:From; b=pSq3sBtVtU2iKcYtmG+0wCEkqvmByR50qN3UYehOGrgRqFweaa/n2SVxvj5+QoXVO gEtzouCK8UT7TChwtGIilwALcm39gTgNOPNCR63LmKFxtqR3uX5tL3c6mfvR0KpUFL qBVt1MhFb0w7XDP7OfuF50GFptgMd3uBLr2PLNbY= Subject: FAILED: patch "[PATCH] riscv/purgatory: remove PGO flags" failed to apply to 5.15-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:23 +0200 Message-ID: <2023061723-corroding-vaporizer-cf1c@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 5.15-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-5.15.y git checkout FETCH_HEAD git cherry-pick -x 88ac3bbcf73853880a9b2a65c67e6854390741cc # git commit -s git send-email --to '' --in-reply-to '2023061723-corroding-vaporizer-cf1c@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 88ac3bbcf73853880a9b2a65c67e6854390741cc Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Date: Fri, 19 May 2023 16:47:39 +0200 Subject: [PATCH] riscv/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-4-b05c520b7296@chromium.org Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory") Signed-off-by: Ricardo Ribalda Acked-by: Palmer Dabbelt 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: 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/riscv/purgatory/Makefile b/arch/riscv/purgatory/Makefile index 5730797a6b40..bd2e27f82532 100644 --- a/arch/riscv/purgatory/Makefile +++ b/arch/riscv/purgatory/Makefile @@ -35,6 +35,11 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS CFLAGS_string.o := -D__DISABLE_EXPORTS CFLAGS_ctype.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