From patchwork Thu Sep 22 05:31:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Nikitin X-Patchwork-Id: 12984565 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 7AA99C6FA82 for ; Thu, 22 Sep 2022 05:34:11 +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:References:In-Reply-To: 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: List-Owner; bh=9Zo8uK8gVg1T1rOqK2CrC6cvOb/IPTAwzOYBBpzL+A8=; b=HlO4Qd+LpAcuAg +KJorOSyzMFO2fM+qQUZycFI4NwcL0KIILYSLrr2sGm6FncdQe2paB+SvqvbrKwvdHS/JbYiQ4qcW 57yENeAKO7rUvsH5zbS2BmTaKktRCOx79Pck6HCIpbT+FSrM5yaQZmmJ/qidYw4rjd3DxaYOglTPm 8hEAnmoE8UpxLpxfJXExsjgKI6ZD0IqI937OvZzdXOCFEXdmM4xqGYFziQ42pA1qLy5lnw4YR9aQl 50n+fy39SvQoTZ9lC/YRSqeBWgG5YVCzo3i1pZF2qyBI1VlqfB+GX7t6k3GCy5bAgfGphE2IizG84 APXpj+c3I4FW6SLgs/Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obEph-00DQEV-D8; Thu, 22 Sep 2022 05:33:09 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obEpe-00DQCH-5P for linux-arm-kernel@lists.infradead.org; Thu, 22 Sep 2022 05:33:07 +0000 Received: by mail-pl1-x631.google.com with SMTP id jm5so6777035plb.13 for ; Wed, 21 Sep 2022 22:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=eaz6ZZzobVs4ZGOrwYHQM/Kk9ITDhPdxEg8Bt1PkbOo=; b=gp1syXD960EDwksWcE/cXsJC6FBR/7T41asUdURa6KbF0WHbYvX/7JgyZkJnR31xSW R2QN4ser1APqmuvLWX5c8pdcbH/HbZE40zup5CLKwRM9kbiBNW5PyqcUthnYUF2uQzro 3+082TC7dgU7d9QVdJdjgUL9PoeIRL0iJy1x0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=eaz6ZZzobVs4ZGOrwYHQM/Kk9ITDhPdxEg8Bt1PkbOo=; b=ancPBUiIhM9riXg2IcEb9YZ2+SonpaV+cYFs9kVgGeB55gWcXovNSJHkqzXtZMQt3V 2uG2YcPKmt2FGJcYrLZsChMgTT40gGION7PjZvmdaDAfj13o35fceyV3C5XsbqBB1Z6v MC1JclRO/n05aBy4QSWJUPhwonjmT5wOOohtciSLSy0W+8N/b1u3eaabVodbA1R2/y0m xkvNs4F41bHabc9eYncnr/p87canf9t8UL401PZMN2H+/1UinZ5Wd9ObsX7QlW3Jb/wa NR+hNYo0oWhNJKuOqQ9M1INM8UcSLzrORgilnisZsz8VdeLGzjOqycLVNQihbOzFjQOx K+jA== X-Gm-Message-State: ACrzQf1s3g3pe6/EfCAYGW+ANdaGhOKMbosOWCxL4qAKX/HovOaszESK C+l7UwhDoorpzChJ8UYbcoAz2w== X-Google-Smtp-Source: AMsMyM7HqZ7Z3byol1GnlGc5Fi7MDzpmzIZjyH6g+1U93zDQm5u+l5l7g/ZrmPjsCSBhDGWebRc+FQ== X-Received: by 2002:a17:903:41cb:b0:178:36c2:a98 with SMTP id u11-20020a17090341cb00b0017836c20a98mr1553573ple.47.1663824774600; Wed, 21 Sep 2022 22:32:54 -0700 (PDT) Received: from localhost ([2620:15c:2ce:200:5e9f:5b94:af12:8e6d]) by smtp.gmail.com with UTF8SMTPSA id m1-20020a170902bb8100b0016d5b7fb02esm2984746pls.60.2022.09.21.22.32.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Sep 2022 22:32:54 -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.cs.columbia.edu, linux-kernel@vger.kernel.org, Denis Nikitin Subject: [PATCH v2] KVM: arm64: nvhe: Fix build with profile optimization Date: Wed, 21 Sep 2022 22:31:45 -0700 Message-Id: <20220922053145.944786-1-denik@chromium.org> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog In-Reply-To: <20220920082005.2459826-1-denik@chromium.org> References: <20220920082005.2459826-1-denik@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_223306_225445_DC02E985 X-CRM114-Status: GOOD ( 12.88 ) 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. Remove ".llvm.call-graph-profile" SHT_REL relocation from kvm_nvhe to fix the build. Signed-off-by: Denis Nikitin --- V1 -> V2: Remove the relocation instead of disabling the profile-use flags. --- arch/arm64/kvm/hyp/nvhe/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile index b5c5119c7396..49ec950ac57b 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -78,8 +78,10 @@ $(obj)/kvm_nvhe.o: $(obj)/kvm_nvhe.rel.o FORCE # The HYPREL command calls `gen-hyprel` to generate an assembly file with # a list of relocations targeting hyp code/data. +# 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. quiet_cmd_hyprel = HYPREL $@ - cmd_hyprel = $(obj)/gen-hyprel $< > $@ + cmd_hyprel = $(OBJCOPY) -R .llvm.call-graph-profile $<; $(obj)/gen-hyprel $< > $@ # The HYPCOPY command uses `objcopy` to prefix all ELF symbol names # to avoid clashes with VHE code/data.