From patchwork Fri May 19 14:47:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 96477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1302410vqo; Fri, 19 May 2023 08:04:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Bos6QCA65t1aIoGao3mCeWTgEErmw0JYnEqgnaWRr1TYRkVmPefbT/OX31HSuojl5iCDf X-Received: by 2002:a17:90b:1050:b0:24e:507:7408 with SMTP id gq16-20020a17090b105000b0024e05077408mr2316409pjb.37.1684508639841; Fri, 19 May 2023 08:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684508639; cv=none; d=google.com; s=arc-20160816; b=UkAh64mdAcK5i7TIz6KIeghMlkKVGmbB9cR8t2/7juLedUHprJbDMj3zboa/PEuenQ d3ISiqfEAYN2mRCuT17Ys7GMIsfopDdJT7jSDcQ5dsX2NWii2QyghzAlybUnQuZ9+rfb Sq/TJ3aW10d4lg+MKcbVCCk84zfwvtV9eTK3gUHp+FWjwY9YUIcABiNqs+J1NZeKegj8 2LIz94BrV4vyeQ5qayKnb39PlHZHQaPtGK3ltXFG9hi7nNf7//MjMFLigH+prHmAukSR 6d4BaNq4YSSYq7KhCwu3R+Xpjr9OwZqy5BFoIdNnIvrnkTjd6yzmXUgFD0VaYmBgJZRO ybGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=tXwbVblZO4SjZiyR2RJlU+1lPwt65C7sEIHn8p960bg=; b=nlPiuY6mcMvcXS/hjk6iYWPBndpigVah04jt/ZfHrekaIoW/L5vom6GCYH4HhNqm3c J/GdWyqxTjw17C0nQO6NRFE8+cypuqftP8G0rk2NRpRPlXN0bag0Nz2OGI7jUNasvmUJ K4yspufY0EQr0JXCOsiD9GyX/rCwgRKSZKBc6OSvaEBrm2GM8UUM7x6LCDMna5qH9i66 46TB+YsAVbi484ncBYjZi3xY0zG7a9Uus2Wr84mVXYdJa21Ztmgofiu+3c5SAO5bYOaJ LMt+wqHjwnLL0ukaACGt6cotOMzqPoqybYqstLxBtwDpHxWQgTLUVsYwnQsi2NZTeT2K BnbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VaD18pva; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a633744000000b005303a7ca052si3832424pgn.491.2023.05.19.08.03.45; Fri, 19 May 2023 08:03:59 -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=@chromium.org header.s=google header.b=VaD18pva; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232181AbjESOso (ORCPT + 99 others); Fri, 19 May 2023 10:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbjESOsc (ORCPT ); Fri, 19 May 2023 10:48:32 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 426B91B4 for ; Fri, 19 May 2023 07:48:29 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-94a342f7c4cso636589966b.0 for ; Fri, 19 May 2023 07:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684507708; x=1687099708; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tXwbVblZO4SjZiyR2RJlU+1lPwt65C7sEIHn8p960bg=; b=VaD18pvaYOrPW92cQcoX/NEFyAia0fIgR3ptOsuxx7KqL2m3/Fogz3ohdrjtw8jIAf /EDDCPYx2T0p21USc97DaVoXS6yaR7TsMgEpNMeajTXb8D6rWvFbDapW+nC79TBs8v+N rMi14ZDfRFVBtp/DNGdIPfZ3+MAQ50UYsHPYQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684507708; x=1687099708; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tXwbVblZO4SjZiyR2RJlU+1lPwt65C7sEIHn8p960bg=; b=jKWHiTri4FYvKaUdsK2Yun5LzVMq0hR5qdiz2n7Tp0ed+WQpXWXu7X/WCPQ+QMjdUR kaUh8ljQgwpZGj91GOBTQs3kCZNgsxd4KjKHTxjkRnVTbwZExlUtGxq3mTbvtV6NgHRB pAUj8IEpUda/Ok4kpWQMOVjEvTz/RdSNjEKCwCVpku+ke8XNQId2JJshk1QMqxrGspOQ xwYDABIFWCTdYlZpFx99a07cmUZp4nXOul+8f3zE3Em+aeP3c+cgrr2meGFopfOBQnwq RDow317G15ebnowMY7TcjN7UWy6ymllKiA3nuXNAQa0S1FKWxOjoiWFtlhTLSFU4OWAT jxvw== X-Gm-Message-State: AC+VfDxLSxE8esDhhqe0rpQq+YGk578BZTPMh+viM2bkgoiCM5/QSD50 v9eL/WoZFEmZh/Wqr+WygyQcUg== X-Received: by 2002:a17:906:5d09:b0:948:a1ae:b2c4 with SMTP id g9-20020a1709065d0900b00948a1aeb2c4mr2454616ejt.6.1684507708255; Fri, 19 May 2023 07:48:28 -0700 (PDT) Received: from alco.roam.corp.google.com ([2620:0:1059:10:62fd:274b:c2ab:69bb]) by smtp.gmail.com with ESMTPSA id a2-20020a17090680c200b0096a68648329sm2349437ejx.214.2023.05.19.07.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 07:48:27 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 May 2023 16:47:38 +0200 Subject: [PATCH v7 3/4] powerpc/purgatory: Remove PGO flags MIME-Version: 1.0 Message-Id: <20230321-kexec_clang16-v7-3-b05c520b7296@chromium.org> References: <20230321-kexec_clang16-v7-0-b05c520b7296@chromium.org> In-Reply-To: <20230321-kexec_clang16-v7-0-b05c520b7296@chromium.org> To: 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 Cc: 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, Ricardo Ribalda , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1118; i=ribalda@chromium.org; h=from:subject:message-id; bh=nWZ2BYP6i2Y8oRo+uF2PHambNY95ZiGn4TiaTAGbKto=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBkZ4wyHkNCHhezyfivzJzrNGMs0K4vUNQRc3pJJ kWHuaNU3qOJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCZGeMMgAKCRDRN9E+zzrE iP+cEACcWHC3j1LmIzpKx/SEOuyu+T8juc3Qsp240gztvu/viz42y8/iBia84BlsRwErLK2OL0F 3ajW94BvdF+hTyHozZEgIagItfSauWAbew6wVa0Qzfv2fr5mU42KfHptzq1l42en7K2rPbcBmLI I2P1/oqo/f6jOgRfm+rkNph26o3SqzcGwOrNJxLkICIjOt2ryabXBD6m79TkrzdPaB9SoChGJac O79LnGL81Pw+Yncu0mYsV4I5Rjw5ZeyFHdpQ7Fz5EA8wvSDDG6odoFxcqf4yE6+bmUv/49AELSz 4dxJdTvbEKZro9lHA0iSPkRPv/S0GQJu/n8ilKFXAYPfqAfDYAN86mjt4xRWsDrK/m2U5bJyQDO y1Bsea8Nuec1BFMA7YRXUDVC9wxgK6i5U1QYeDdEOWjG8KsrN7aDk6FT7Vs5HVZVFlpaYzxI1Qy OuCwULJN4OB++Blq1pndCgv3Enk4iWEnD3tV8M5ZGZEkwnZmi1PxTzTAUZrdHBuiBcGUJURHEal /D5/1Q6A+bUxW980Yzwcu1tPuxwKe1lCW0boDcrNi3inwoNG0wyymcZvtfl/+IKzenjCXxuZ8c4 54evV8xE1nlppSTiE5EscgwFuFxb6elq+Frz99s4912olrL9bjc84OFEQ1brCORAnz/ZbTuENqO ZuH2pEvCDHPT0rw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766335331921025286?= X-GMAIL-MSGID: =?utf-8?q?1766335331921025286?= If profile-guided optimization 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 Acked-by: Michael Ellerman (powerpc) --- arch/powerpc/purgatory/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/purgatory/Makefile b/arch/powerpc/purgatory/Makefile index 6f5e2727963c..78473d69cd2b 100644 --- a/arch/powerpc/purgatory/Makefile +++ b/arch/powerpc/purgatory/Makefile @@ -5,6 +5,11 @@ KCSAN_SANITIZE := n targets += trampoline_$(BITS).o purgatory.ro +# 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)) + LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined $(obj)/purgatory.ro: $(obj)/trampoline_$(BITS).o FORCE