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 3AC1AEB64DB for ; Sat, 17 Jun 2023 08:13:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346304AbjFQINj (ORCPT ); Sat, 17 Jun 2023 04:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346312AbjFQINh (ORCPT ); Sat, 17 Jun 2023 04:13:37 -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 553B12962 for ; Sat, 17 Jun 2023 01:13:36 -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 DFF91611B2 for ; Sat, 17 Jun 2023 08:13:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 021F9C433C8; Sat, 17 Jun 2023 08:13:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686989615; bh=7CpK2UCu7VATcFnc0ltd50l6WFeJi5P+lYVXmB+HObw=; h=Subject:To:Cc:From:Date:From; b=CWri9qqtjSlenZeUJX0eTBQ240zkdx4PM6tTOFXQrQXqqQzk/2eHUOJqzMwqcqpuA g0EUK4lK2wlTWAlO36zE5sQO8FgiaOtbPtnUKsLGBP4fVkg6DBQimuejsuIp5byGkx 7hXgtE7NxUGX9GVctouGpyd29PO+gQKM2LwWLU60= Subject: FAILED: patch "[PATCH] riscv/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:27 +0200 Message-ID: <2023061727-reverb-postbox-4067@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 88ac3bbcf73853880a9b2a65c67e6854390741cc # git commit -s git send-email --to '' --in-reply-to '2023061727-reverb-postbox-4067@gregkh' --subject-prefix 'PATCH 4.19.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