From patchwork Fri Oct 14 18:45:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Nikitin X-Patchwork-Id: 13007279 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72B02C433FE for ; Fri, 14 Oct 2022 18:48:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pCaYARvi2wsnMvpLmF0CL7Keq1CtfGd9kzWqMila4Mk=; b=Rotqa0i335Zieb +6an0wHEQknBNbbPzfr/8kQwCC/Hsoh+a/Ks349pd7F5SfB2IgARgSVm29DxTYbXeWzuXLpdX9dgr 55mVFMki+2vkberfznhV6MlcRJdylK5KwkZ+AJj3iYt/xPwks63SsADG93pCBRSwBkSCsKRaa/Uvb NYRvvn2sR2XXWK1cJLj+SNYpKPMu7CbPcyEyXFuqKht3g5uPGRI4bvy0qeKhXnOyg7eM+VPGL+x8L jqhNtDJMcJ2pGjPJcrhNkShR42uxCbTOjslHskOfnPj6wbakiMKGTiGjSrp2cppC7XtLJ76B+K0fA GdqzrBCXPpwN3nMvxsmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojPhi-00Fe27-6z; Fri, 14 Oct 2022 18:46:42 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojPhf-00Fe1j-8Y for linux-arm-kernel@lists.infradead.org; Fri, 14 Oct 2022 18:46:40 +0000 Received: by mail-pg1-x541.google.com with SMTP id q1so5037654pgl.11 for ; Fri, 14 Oct 2022 11:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=r9b1WxYCtQHAvJQbAPYaXXw5JIstR8dPjphyBTVotDg=; b=C9ChpAljNx+6EX+b7MIXOhJ/DxR1oEgil1ZdehQzrOHu0htP0Wb4hihn7cdKw7kusB unlXoi0fYM8ckb4UqUThqiouQ/fgrebyEJmB7iEik2j7ocpYju1X+GtQNb/e2THXGyfu pdn2pYHgdd7SXL+E5NiLfpnCE8W4Xn9DguZTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r9b1WxYCtQHAvJQbAPYaXXw5JIstR8dPjphyBTVotDg=; b=VfPX3s/2ZagjuETAhezPJWliF1SR27+B30fle2ovnCklomsJpCFeq4t+oevkxjk048 tDUyC8smvi0jdCBgb3hWUdvfPt814QC5LRpdC7Ua82EvAowa5+KOF51ANxm9Xm431b0z TZ/mjvAvI524MpZEH04frHBmOxS3yMXlYtUaPfNSEFgtCyZ+SZwqDWMM2F35XiUYIVUd Ez3icL3HSG+ygvMgri4BeY/LP+Xd5NHaRr117K7N+W9GT3gLm41o9+sYsQYmKfWYAR2h GvedspvUPkxFdKMeV05J1/6bEU92cslTDqrCr/eHZ3c/7h4ajSIrs9UnC5tgBYuTNIdc 9c0g== X-Gm-Message-State: ACrzQf0+7zBw1K0bl7MkAM51JFWqr/O9zNL+FtDJCVm0P1lKt039ISX6 dyoXPrBDpMQO/uW33UjRnfq21g== X-Google-Smtp-Source: AMsMyM4KxZFUnZ3+JVUZbSV1KdBMKe5N17ONrn6zYeMpUbJ+0CiKCyk427n5W/she7eWjJeNE5SITA== X-Received: by 2002:a05:6a00:1707:b0:562:e790:dfc3 with SMTP id h7-20020a056a00170700b00562e790dfc3mr6609803pfc.59.1665773196248; Fri, 14 Oct 2022 11:46:36 -0700 (PDT) Received: from localhost ([2620:15c:2ce:200:e8c9:5029:f577:f6ca]) by smtp.gmail.com with UTF8SMTPSA id 203-20020a6217d4000000b0053653c6b9f9sm2047145pfx.204.2022.10.14.11.46.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Oct 2022 11:46:35 -0700 (PDT) From: Denis Nikitin To: Marc Zyngier , Catalin Marinas , Will Deacon Cc: James Morse , Alexandru Elisei , Nick Desaulniers , Manoj Gupta , David Brazdil , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Denis Nikitin Subject: [PATCH v3] KVM: arm64: nvhe: Fix build with profile optimization Date: Fri, 14 Oct 2022 11:45:32 -0700 Message-Id: <20221014184532.3153551-1-denik@chromium.org> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221014_114639_350894_3838C131 X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Kernel build with clang and KCFLAGS=-fprofile-sample-use= fails with: error: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.tmp.o: Unexpected SHT_REL section ".rel.llvm.call-graph-profile" Starting from 13.0.0 llvm can generate SHT_REL section, see https://reviews.llvm.org/rGca3bdb57fa1ac98b711a735de048c12b5fdd8086. gen-hyprel does not support SHT_REL relocation section. Filter out profile use flags to fix the build with profile optimization. Signed-off-by: Denis Nikitin --- V2 -> V3: Filter out the profile-use flags. V1 -> V2: Remove the relocation instead of disabling the profile-use flags. --- arch/arm64/kvm/hyp/nvhe/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile index b5c5119c7396..16c6abdda494 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -89,6 +89,10 @@ 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)) +# Starting from 13.0.0 llvm emits SHT_REL section '.llvm.call-graph-profile' +# when profile optimization is applied. gen-hyprel does not support SHT_REL and +# causes a build failure. Remove profile optimization flags. +KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%, $(KBUILD_CFLAGS)) # KVM nVHE code is run at a different exception code with a different map, so # compiler instrumentation that inserts callbacks or checks into the code may