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 E9E5AEB64D9 for ; Mon, 19 Jun 2023 10:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232220AbjFSK6g (ORCPT ); Mon, 19 Jun 2023 06:58:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232323AbjFSK6H (ORCPT ); Mon, 19 Jun 2023 06:58:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A813C2F for ; Mon, 19 Jun 2023 03:56:10 -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 7BC5960B4B for ; Mon, 19 Jun 2023 10:56:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7175DC433C8; Mon, 19 Jun 2023 10:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687172169; bh=2EQWVAFCIMIqqSd1TtXCSrRyl/HOejH2CKQM2OmhEvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TnoJ9KNqJfRMpxGa7jG/+vJ0Vez4EXcsMuuroOzjnxkI28cCv/JI7PTU5/dhJN3qh iVqZHZZu9e3uWUoL0+Xhkc2zxdHt6c9rvgbFIk3Miu7ZbFH6hk3HAyd+AIhhzBDcwh HaiYgzMDzhd6cqmVd9S3xtQd3AWx1JilQFq0TCLY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ricardo Ribalda , Albert Ou , Baoquan He , "Borislav Petkov (AMD)" , Christophe Leroy , Dave Hansen , Dave Young , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Michael Ellerman , Nathan Chancellor , Nicholas Piggin , Nick Desaulniers , Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Philipp Rudo , Ross Zwisler , Simon Horman , "Steven Rostedt (Google)" , Thomas Gleixner , Tom Rix , Andrew Morton Subject: [PATCH 5.10 35/89] x86/purgatory: remove PGO flags Date: Mon, 19 Jun 2023 12:30:23 +0200 Message-ID: <20230619102139.881942314@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230619102138.279161276@linuxfoundation.org> References: <20230619102138.279161276@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ricardo Ribalda 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 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 Signed-off-by: Greg Kroah-Hartman --- arch/x86/purgatory/Makefile | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile @@ -14,6 +14,11 @@ $(obj)/sha256.o: $(srctree)/lib/crypto/s 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 -nostdlib -z nodefaultlib