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 7AE81C7EE25 for ; Mon, 1 May 2023 17:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232455AbjEARlL (ORCPT ); Mon, 1 May 2023 13:41:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232402AbjEARlJ (ORCPT ); Mon, 1 May 2023 13:41:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE257CD; Mon, 1 May 2023 10:41:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8212461E2D; Mon, 1 May 2023 17:41:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33E2EC433D2; Mon, 1 May 2023 17:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682962864; bh=81z/8+VNCOs2KfOTGMvYGJr78DCfPa8M7ZOzDNUfnCY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ghv0PKPSEF/qiYfWNIgVqzcxiV94CKnm+WiWCSyBxEUEJUm8nsJSuKOqtmJA871/J ajyg3xFZJvtCjWeS5XL4b4A6p8W8Eh4h5g7M6hUgv55S5cuvquU2/FPaVa5zMKrCwl p80tb777MSmmUOy4bAcn4YGjMwqaK97HS/0AXg1GmQZpUeeLgggQKhUGaoUJaJStfa 60Dn1OZ5gbzQA/kDtxoEWTYgtega7R78ZTGPMTGp8mczgGW/rre5vijVDFKcWvkkOr osLrwqrSAODauKYj4W7bSX2Zm4Wj/8RL9xM/EboyvOZepXnzmaugABHmtdX2GOg6Wj 4b93L3bPQNt+Q== Date: Mon, 1 May 2023 18:40:56 +0100 From: Conor Dooley To: Ricardo Ribalda Cc: Eric Biederman , Philipp Rudo , Dave Young , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nathan Chancellor , Tom Rix , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Baoquan He , Philipp Rudo , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Ross Zwisler , Steven Rostedt , Simon Horman , Nick Desaulniers , llvm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH v6 4/4] risc/purgatory: Add linker script Message-ID: <20230501-cottage-overjoyed-1aeb9d72d309@spud> References: <20230321-kexec_clang16-v6-0-a2255e81ab45@chromium.org> <20230321-kexec_clang16-v6-4-a2255e81ab45@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fl35W8zTCu+OA5lB" Content-Disposition: inline In-Reply-To: <20230321-kexec_clang16-v6-4-a2255e81ab45@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fl35W8zTCu+OA5lB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Ricardo, On Mon, May 01, 2023 at 02:38:22PM +0200, Ricardo Ribalda wrote: > If PGO is enabled, the purgatory ends up with multiple .text sections. > This is not supported by kexec and crashes the system. >=20 > Cc: stable@vger.kernel.org > Fixes: 930457057abe ("kernel/kexec_file.c: split up __kexec_load_puragory= ") > Signed-off-by: Ricardo Ribalda > --- > arch/riscv/purgatory/Makefile | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/arch/riscv/purgatory/Makefile b/arch/riscv/purgatory/Makefile > index 5730797a6b40..cf3a44121a90 100644 > --- a/arch/riscv/purgatory/Makefile > +++ b/arch/riscv/purgatory/Makefile > @@ -35,6 +35,11 @@ CFLAGS_sha256.o :=3D -D__DISABLE_EXPORTS > CFLAGS_string.o :=3D -D__DISABLE_EXPORTS > CFLAGS_ctype.o :=3D -D__DISABLE_EXPORTS > =20 > +# When profile optimization is enabled, llvm emits two different overlap= ping > +# text sections, which is not supported by kexec. Remove profile optimiz= ation > +# flags. > +KBUILD_CFLAGS :=3D $(filter-out -fprofile-sample-use=3D% -fprofile-use= =3D%,$(KBUILD_CFLAGS)) With the caveat of not being au fait with the workings of either PGO or of purgatory, how come you modify KBUILD_CFLAGS here rather than the purgatory specific PURGATORY_CFLAGS that are used later in the file? Cheers, Conor. > + > # When linking purgatory.ro with -r unresolved symbols are not checked, > # also link a purgatory.chk binary without -r to check for unresolved sy= mbols. > PURGATORY_LDFLAGS :=3D -e purgatory_start -z nodefaultlib >=20 > --=20 > 2.40.1.495.gc816e09b53d-goog >=20 >=20 > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv --fl35W8zTCu+OA5lB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZE/5qAAKCRB4tDGHoIJi 0tO7AQDCFxxBDCm6m1lRjliaYENcoYHVqFHrLwGzbHGrXVn/VQD/aKUuG6nnmBC9 4JdlDj98flb/kiL3Z25m/1+UmBAjSAk= =uz5+ -----END PGP SIGNATURE----- --fl35W8zTCu+OA5lB--