Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5794231rwr; Mon, 1 May 2023 10:50:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZA9YHkRZLQKj4cO0mGgp7m5LqfgZLsi6rv9fWGWWBigme78PInVOSv1qma4jssXktzM9R X-Received: by 2002:a17:90a:c253:b0:24d:f8e6:9d4c with SMTP id d19-20020a17090ac25300b0024df8e69d4cmr4572074pjx.49.1682963430507; Mon, 01 May 2023 10:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682963430; cv=none; d=google.com; s=arc-20160816; b=tkPHi43Uwq9TtBfvhW+pJ5IJoXfqe1uIAgiiL8amsQK1YnmDIf/JZF3AVaPeYdrRtG sxGOAzlWBOgRTpUfHUFra6KNjj5JB09ukEy8wpWQOo0KtO6blg21is2zIwU+OhcmBB8j 7SZmNtnUdrXWPUUeTJYlqY6eF9uEuh4RHnwxSWp8Y69Z4fG5vaXxwLywX1z9byCBJfN8 0JcClC35TZvLzGPrWxcXeKgQSrWADnUBQeLjrX9zgQkhJj25X/vrU+5YoNTi45pXfuYx 0B5HHwYo4RjE0fF0lJRSiZaPJ2P5f1RprGZPdF0q+FGjJP7IcPWF8jEr+J4E2UB4Mxl7 YL4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z77Xr/6qXSYl8NgmxqxIZbfRwcjagJa8HRdi7Mx8HW8=; b=TgaZV/thIfbD08v0AJipvP5is87kH6JprHm7M63dp9uqtqmUIvlAmzYOO8HUqUgGAD /NrIgnUtun1Y74MfS30uftHfgd3rmdmGiTou6VMGa7/vKX7HDQ1VN2xxeT/oFvhJ3C9U vu8bip8Zq2DX3klU39V/eizBUtUeaGAbeAZdMKBpCswJzybjy+bgbuvIxuCTEYhwTxcd qo70Ggh8fsLxTHH++GLPgo/0fjSzEP2jjuhwDIP8MxmMZnWXjOJsMT0ynF2Av2yTerxC Ytcj52L3AZZ+HtyOl6uGthPEudDURysUmaRPpEkC3EPuW9tM7HaVWUjrT6zkQIWCqW4I t+0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ghv0PKPS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a17090aad4400b00247af9828bbsi31052477pjv.87.2023.05.01.10.50.18; Mon, 01 May 2023 10:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ghv0PKPS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232447AbjEARlL (ORCPT + 99 others); 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> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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--