Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3660410rwb; Tue, 20 Sep 2022 02:53:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63YC8y6ss98siW4ZJC7U6nb6sdIuxyb+F/JYzQhQLdHdrQ8V+6v5lhsbbU+lL1Nn+gc16V X-Received: by 2002:a05:6402:5154:b0:453:7d3a:26ec with SMTP id n20-20020a056402515400b004537d3a26ecmr16943267edd.332.1663667634964; Tue, 20 Sep 2022 02:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663667634; cv=none; d=google.com; s=arc-20160816; b=cqn1KaMRsMq3Mq7FNHm1cCMMZmfs/DDItftPQRBcEK4N3lgcPO+ku/xaxIWnRIY1iS Nd0ZYv7CPoCduymUJL9beefOFjdjd3slzIMieYcA3Qv8UQLvSvpXTA7g2Jsn2bUHwWmw VW+1VA62rHK0liqq/h31W0MfgvCYRGFZkQmWb7PFhyQck8K5prdgEWGaVC2pDWJ4lXLf p3c8+VlAoJnmVDbgrQatBDVIi2UKEAJDZN8EVSEOSsXGRkHU7/grw60W8uuJSS8ULgI7 mTB+ptFMQ56Fso3AEtgTOWVgBr56vtXRNjhmV/9crIUr9JR5LSkOnfiUpw+eyUeghuXB hq5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=/AgHksrqSmUicnJk36G7w/B0v4US9YjfMDHwiD0ywrI=; b=h6UGAxi+OZ3QUcuT9fH9Xmy8kGF8CqYIITZbqiPT1ekfnuz2PH2g+JI6trA8Q41knJ bY9coMmNIKxs1f+qep+MZtIVQPKogPnuWryT0wlg2znahsSPKiGA8UFOsU3K0T6o9Ade Oqo4NcNVIHjLkD5xq8rZk43287TGTiFzWpHfasXhOIQ/sO0akFcPGazgANQ5/Ge0CT35 2RA2tLJneCwLmQFCa/LQYfKcDyYT2wCnd1A8tJBqPoik8SwyVMK59/JIUsjI6If1LK12 7smuf/o/LDjeAc1FD1CjHxZ/36tGB0z1C1vKvkPTaklFgfO6zM36oZfvwFxQduV5PNiW +uhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=keLXcHwf; 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 e17-20020a50a691000000b00451fb0ece9asi1249447edc.485.2022.09.20.02.53.28; Tue, 20 Sep 2022 02:53:54 -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=keLXcHwf; 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 S230500AbiITJeL (ORCPT + 99 others); Tue, 20 Sep 2022 05:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiITJeF (ORCPT ); Tue, 20 Sep 2022 05:34:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D2F851A2B for ; Tue, 20 Sep 2022 02:34:02 -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 6D97961D07 for ; Tue, 20 Sep 2022 09:34:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9AA6C433C1; Tue, 20 Sep 2022 09:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663666441; bh=ivTr2OWvzIQQQO9NkJ0FAL1UtGQNafvVOL27lxo0xrA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=keLXcHwfR31TRqkmv7TlfaBoTFVBCebY6qNkI6YrvDrWIF/WOQcTC/KGfswoEKlR+ 7SD8osmHwzgO5tBAf+/hga19oEnP4aIeGy8U6nPEpwhdCQ7Zn9STsc/cFGhrg5GOx8 j3BFlXztiU1utWrcU6GM3/EfyjTF9cUyGJJh79kuhF2bn9tYYPjAQekmqhOGdeKUh5 a8fnT6S/bvddhsVSG9/3L+56EaLMath2YxXSZbxMo7vOVYulAzMCEfSMb4GmcEp0E7 OtBpyj0/PgJAMWpjr8MsBFbITJ6vkPAR5sIBU+av+ua9JxABXU8MlGwKugX9AVn4f9 zQZzZ+GW54+6A== Received: from 185-176-101-241.host.sccbroadband.ie ([185.176.101.241] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oaZdf-00BMPj-Dx; Tue, 20 Sep 2022 10:33:59 +0100 Date: Tue, 20 Sep 2022 10:33:56 +0100 Message-ID: <877d1yl797.wl-maz@kernel.org> From: Marc Zyngier To: Denis Nikitin Cc: Catalin Marinas , Will Deacon , James Morse , Alexandru Elisei , Nick Desaulniers , Manoj Gupta , David Brazdil , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: nvhe: Disable profile optimization In-Reply-To: <20220920082005.2459826-1-denik@chromium.org> References: <20220920082005.2459826-1-denik@chromium.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.176.101.241 X-SA-Exim-Rcpt-To: denik@chromium.org, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, ndesaulniers@google.com, manojgupta@google.com, dbrazdil@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS 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 Hi Denis, On Tue, 20 Sep 2022 09:20:05 +0100, Denis Nikitin wrote: > > Kernel build with -fprofile-sample-use raises the following failure: > > error: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.tmp.o: Unexpected SHT_REL > section ".rel.llvm.call-graph-profile" How is this flag provided? I don't see any occurrence of it in the kernel so far. > > SHT_REL is generated by the latest lld, see > https://reviews.llvm.org/rGca3bdb57fa1ac98b711a735de048c12b5fdd8086. Is this part of a released toolchain? If so, can you spell out the first version where this occurs? > Disable profile optimization in kvm/nvhe to fix the build with > AutoFDO. It'd be good to at least mention how AutoFDO and -fprofile-sample-use relate to each other. > > Signed-off-by: Denis Nikitin > --- > arch/arm64/kvm/hyp/nvhe/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile > index b5c5119c7396..6a6188374a52 100644 > --- a/arch/arm64/kvm/hyp/nvhe/Makefile > +++ b/arch/arm64/kvm/hyp/nvhe/Makefile > @@ -89,6 +89,9 @@ quiet_cmd_hypcopy = HYPCOPY $@ > # Remove ftrace, Shadow Call Stack, and CFI CFLAGS. > # This is equivalent to the 'notrace', '__noscs', and '__nocfi' annotations. > KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI), $(KBUILD_CFLAGS)) > +# Profile optimization creates SHT_REL section '.llvm.call-graph-profile' for > +# the hot code. SHT_REL is currently not supported by the KVM tools. 'KVM tools' seems vague. Maybe call out the actual helper that processes the relocations? > +KBUILD_CFLAGS += $(call cc-option,-fno-profile-sample-use,-fno-profile-use) Why adding these options instead of filtering out the offending option as it is done just above? Also, is this the only place the kernel fails to compile? The EFI stub does similar things AFAIR, and could potentially fail the same way. Thanks, M. -- Without deviation from the norm, progress is not possible.