From patchwork Fri Jan 13 00:22:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 42882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1557wrt; Thu, 12 Jan 2023 16:27:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjriISdrnKZxEfppNz1Ka5PvYlIHtERn9Yx4NLfm7qTJKmUNtKxyMkpCOyuty4A/UlmkLU X-Received: by 2002:a05:6a20:bb11:b0:a5:7e02:4e0 with SMTP id fc17-20020a056a20bb1100b000a57e0204e0mr8604124pzb.3.1673569659040; Thu, 12 Jan 2023 16:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673569659; cv=none; d=google.com; s=arc-20160816; b=Ern/8tw0JKE4X61+/N3MUUpxwciscmnqxOot+4q6KserwcG3ffI5cWUS2WLzkfENxl efgE6XD50SF4E/4Ic+SjKAfoTgxzKHkC/6T/himLSARFp5R+zp2uMWLJjlF5pQw3EFS4 QRsDSCGhjXU4xtxBp2IQ+5lDPN/z98WBS4oECW/zYy7ADOMisHnBVcO7bL/MvuO34wFq l3leaPcrax7mSHX9WST/XdfpHpBkY6BQwazKNBXDZx7PU+SDl5S7wxHGgTvdUVRQFbEb ILGdRlJbJ3VBLuUTF+UGxsJB38Y/Vddd/9OjmyYXaVyeGBBanHadnNQ3TV+ikshi8ZVK ESeQ== 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:date:subject:cc:to:from:dkim-signature; bh=yDLd/c7sffLZEFLE9eRRXtPje9jgj2d5fJUXABkKQP0=; b=I6f1zMRehyeQEiJ75+MvSUxM1/Oz2P+Eu1bUE9l7YpRK8riBb0nGtdl0VOSFzauC9V OFgyKq2uCNEVS7f3y+1oT8s3N4dWs9U8W1BXAAl0xUOQ5V6wUIeFW3RlJCXC890nMtxg W4Loct9H75qvuJSRpfrahpQ8uXKg9+Qqq5yt2DDUsxjkd1y5Et352850MXu0uyVbpjsV MTEvtdC3OEhq56Lj6qpWDy0NOHq4n5NtQ548rZX8QrpnTJSLILD+mu1goObejVYY0p5u 4dHi3sdq22/Du8dCGTah7OF2srcwlHQIW1g4BqlKCc7SiCEQ64wwdKPD2Tgc6HlU+Eho y+Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="LpjSq/Ka"; 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 f21-20020a63f115000000b00489c72b232fsi22542174pgi.707.2023.01.12.16.27.25; Thu, 12 Jan 2023 16:27:39 -0800 (PST) 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="LpjSq/Ka"; 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 S239837AbjAMAWd (ORCPT + 99 others); Thu, 12 Jan 2023 19:22:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbjAMAWO (ORCPT ); Thu, 12 Jan 2023 19:22:14 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6439BC66 for ; Thu, 12 Jan 2023 16:22:13 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id o13so17298804pjg.2 for ; Thu, 12 Jan 2023 16:22:13 -0800 (PST) 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=yDLd/c7sffLZEFLE9eRRXtPje9jgj2d5fJUXABkKQP0=; b=LpjSq/Kastw9Uyx7f/r+AXRPp75VX1xPSml8w1HOfumTaSgX7Xs9RsbvsIteXr691a PvgtLM027UA7L5VjfdjU8Pk4kFOUF/8BrFWFSiQwIS8PEVk/CY3TRIgds4VX8JWsbCIQ /duk64ketG1O8Sh7/btJxqHc1xiTUw73+XzcQ= 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=yDLd/c7sffLZEFLE9eRRXtPje9jgj2d5fJUXABkKQP0=; b=naa+c9MDk97ZAkmIAFucIqT27cEo/qyiV0BH2GBsxN5IsWJsrpEtVI7wwbfF5tT5Xt D3QPAtlcW9c4nfY6OkGC3qYI6dS+Lv0h+riF0nf5IGlN/hM6NxBVuLdZG0ThEt0gR9vF x6rYKqWeTIzYZ2grWcIxo6zm3o54+VYhZncgu3eIteX7QL35huqu/AdJmBrli9uKtXou w/QnKuKjclle9RpxEixWeNLbEXAEHFwvvykOKJVI/4UsgdhpLqefIWrClpiu7OHc7NnY Nf96T9IE1mGK2tPKqhuE8lGvcEuxKQ7FTLfYJrQRh4PQ6lYexeALWlVSXuh8qf17KxjV UHeg== X-Gm-Message-State: AFqh2krzP7ZsPeaWKOwXPFQCtzKKHtWmGA2pl7Z7qeZyjY8+UBYD93tl ayr1krZVzAYFc7Dau3dKKuaeqA== X-Received: by 2002:a05:6a20:6707:b0:af:9538:ec5c with SMTP id q7-20020a056a20670700b000af9538ec5cmr9033204pzh.51.1673569332751; Thu, 12 Jan 2023 16:22:12 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:11a:201:4652:3752:b9b7:29f9]) by smtp.gmail.com with ESMTPSA id 75-20020a63074e000000b004b5fb50aa6dsm4748931pgh.83.2023.01.12.16.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 16:22:12 -0800 (PST) From: Stephen Boyd To: stable@vger.kernel.org Cc: Denis Nikitin , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Marc Zyngier Subject: [PATCH 5.15.y] KVM: arm64: nvhe: Fix build with profile optimization Date: Thu, 12 Jan 2023 16:22:10 -0800 Message-Id: <20230113002210.3984665-1-swboyd@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754864978740231624?= X-GMAIL-MSGID: =?utf-8?q?1754864978740231624?= From: Denis Nikitin commit bde971a83bbff78561458ded236605a365411b87 upstream. 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 Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20221014184532.3153551-1-denik@chromium.org Signed-off-by: Stephen Boyd --- I need this to properly compile 5.15.y stable kernels in the chromeos build system. 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 8d741f71377f..964c2134ea1e 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -83,6 +83,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