Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5419656rwr; Mon, 1 May 2023 05:45:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pVRGh1r9cWXQPAxgb5xLmxgRhA4Pu3Gw6Qhb8jooj3d1eHTBRF8CcOJu9ng/rsl3Fy96L X-Received: by 2002:a05:6a20:a5a6:b0:f2:5b9f:fe61 with SMTP id bc38-20020a056a20a5a600b000f25b9ffe61mr15791953pzb.34.1682945151942; Mon, 01 May 2023 05:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682945151; cv=none; d=google.com; s=arc-20160816; b=eXkeTDxLz8ykXF23WYsTwZMlj8xSBbzO0pIXp+aArco6mKEkfXnrgDHehZLvatNV1S MnAKlATgxqO5b+befjLISNgKtq65zYxGdupO1euUE2g4vGRKmlgz7FqMN76sy4nD4/un WgCq5KK8HPs0UvwggKhY/f3X9kGxI11+6zZj/aJ/X6SjqsktVNGKEJTlfEnFUIoVAJNU /Ox2CGZ2QCADZ/lyp73/5SxpjUXIm3rEkXDCAbQg0nX5a9xWM9lvxfID4v35YyK5xAVg 864YckHUWLtp920pM4dShhf1xANRHHyx+uxcaqan/bTp4HR7mjOkrdG4Z1GRTwUl17yZ zHTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=U+/m/Q8rJDfBtNlvA5MoeSZihLHMU+hMCap0lrbB/rs=; b=lzfN3CqNHANaEwzcdMdENNzQUSTn9vFXkvqbpOSOJX5KaquZP0eOvaDKm7IW0kpP8r yD5fQ6Q/2N9LUftj7GVus4XFdV73fu55Wd7zDZ5eZzzT0VHXiEVKO79/ds/IsbByEFXp P3eWerQp4I8MuM8M3wKeG2/gIMPJmwKnN+y+AWQXbXzDZQVoRLIl0QBKoEWA/dnXb6m2 uCuC39wBDzR/+wc2NEcT+8JgwZ67UCOsviWo735WwMRMEI/DZge6Nv2NqIv9F3gjX7qf 2wddvBXoSeVLtzbZS+NAojp8YOXPQSnEVjuJIwbKgyVvss3H/UsAUK7f3pGrt/9TCG6k dwZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=cwwHyIgX; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b0052525c3451bsi21581163pge.825.2023.05.01.05.45.37; Mon, 01 May 2023 05:45:51 -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=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=cwwHyIgX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232621AbjEAMpD (ORCPT + 99 others); Mon, 1 May 2023 08:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbjEAMpA (ORCPT ); Mon, 1 May 2023 08:45:00 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81FE619A4 for ; Mon, 1 May 2023 05:44:33 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-63b8b19901fso2898343b3a.3 for ; Mon, 01 May 2023 05:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1682945067; x=1685537067; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=U+/m/Q8rJDfBtNlvA5MoeSZihLHMU+hMCap0lrbB/rs=; b=cwwHyIgX4KWvvBvY8nSBkLAFNRsKMYzp6WW1Di0i93YYJQgPlYiPsZZCu6Q8jvx894 ycO1ma38TjwwxCTgtSZueTlcY4Th+uxr3S4GZBnOqQEH/2pBTsxgbr9pWx/8L3JZczbj MnpoznAqXqI5UK+Sm37GsXne1PqltuZm1m4Xu8tVG+/im46OIrq2m1j0tSR/GAxO8Bh4 VdlXDlQkolJTQQTRdSXDTZdb4WP2mQUEn80kYCVF+/O11w7FZ444LzumBUmo4iRb4nVZ uU5vUU+SbF4ykTZ8FxZUOcJJPtSPqDIpmNPWpIGo5upiSDMbV64yvLxaou3JoJtoNA5f aYLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682945067; x=1685537067; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U+/m/Q8rJDfBtNlvA5MoeSZihLHMU+hMCap0lrbB/rs=; b=PEF+KGHXH9n4k9qkFvuq0bnzeD8O5FVV8myNWv6hRSJJaTKByk76mdMFIeTj3Lgd6s exLM/7Kdt8ODg4UhpRf5sFyfE4AkGQvm4YXRMkI2z4DW6pEnJqhxUuky6Ons4UGG82S9 ryOBiqiHFflLmhVxQ8gpCRbIvTJcLOQ/mWpXNjiS0ik3e3AUVgZnSj9YnpcZfNs87jVQ kj+Oz7MOykCT/F+P6TH2gN3NmvwZpcOuOudo46rSTuaXf2JTZBWi34JKtAKLzEAjTM3C gqiqVsp2crz8m8vYYi2I8k4pC7UmyeaGF2ObgY2JDsER7BPSFOOzaIi5FsNLaDUdvq+2 TAQg== X-Gm-Message-State: AC+VfDwyFClBZuXXm7ygP9Xm1DvktAyym6a6X0FI4ZBXKWVSUezGgbKO gWWABZPBRvCH9x2u42LtmeNnbg== X-Received: by 2002:a05:6a20:6f03:b0:f8:b39b:b24e with SMTP id gt3-20020a056a206f0300b000f8b39bb24emr14578405pzb.11.1682945067231; Mon, 01 May 2023 05:44:27 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id v17-20020a62c311000000b005a8bf239f5csm19690294pfg.193.2023.05.01.05.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 05:44:26 -0700 (PDT) Date: Mon, 01 May 2023 05:44:26 -0700 (PDT) X-Google-Original-Date: Mon, 01 May 2023 05:44:09 PDT (-0700) Subject: Re: [PATCH v6 4/4] risc/purgatory: Add linker script In-Reply-To: <20230321-kexec_clang16-v6-4-a2255e81ab45@chromium.org> CC: ebiederm@xmission.com, prudo@linux.vnet.ibm.com, dyoung@redhat.com, akpm@linux-foundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, nathan@kernel.org, trix@redhat.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, Paul Walmsley , aou@eecs.berkeley.edu, bhe@redhat.com, prudo@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, zwisler@google.com, rostedt@goodmis.org, horms@kernel.org, ndesaulniers@google.com, llvm@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, ribalda@chromium.org, stable@vger.kernel.org From: Palmer Dabbelt To: ribalda@chromium.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 On Mon, 01 May 2023 05:38:22 PDT (-0700), ribalda@chromium.org wrote: > If PGO is enabled, the purgatory ends up with multiple .text sections. > This is not supported by kexec and crashes the system. > > 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(+) > > 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 := -D__DISABLE_EXPORTS > CFLAGS_string.o := -D__DISABLE_EXPORTS > CFLAGS_ctype.o := -D__DISABLE_EXPORTS > > +# When profile 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 Acked-by: Palmer Dabbelt