From patchwork Thu Mar 4 18:45:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12116663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33CDBC433DB for ; Thu, 4 Mar 2021 18:48:01 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98F8164EF8 for ; Thu, 4 Mar 2021 18:48:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98F8164EF8 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version:Message-Id:Date: 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=uRQyHSilHL7aBY7fhQ6PhvYkAGxAXgVYM4xYXgPfDXk=; b=pm8YxEliLBAbKv4IPQAFX9vC8Q N/jbqK+209GbS/iGAL9aaFSlWwglqwjoQwg8N7EYxnFLNEYflkYzFkndSDYrzW9ylNkRKVZf9cRR8 d+6/oaedQlY4Wo8aJm3KL+lbu1+COGL401QcM2gWI9GnIktZg3Rl9el0INOvRGe/DpnLdfOK/Yydl I+nD5iIfKZ4Sjqvu/iJnke4x8RRDo/gDcJiTPkKIC/oUmnR4YpdmXjc3GGTT6pPyBidVBlt7SRSN+ 7JBq9t6bYzPJvpwLg2MttCY1rt8RBNCsG29/Z/wnvrc3mDt/iKtrN3lUnVTlrnsFjr6nBh95HeAfb m46pzy0w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHsz3-009cjS-En; Thu, 04 Mar 2021 18:46:01 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHsys-009chr-Cd for linux-arm-kernel@lists.infradead.org; Thu, 04 Mar 2021 18:45:52 +0000 Received: by mail-pj1-x1049.google.com with SMTP id lj2so333529pjb.1 for ; Thu, 04 Mar 2021 10:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=FHJbv/IQitHrDrqVV5Zv3feuTlL4Ima66irM/2+LBrM=; b=wRgnh5UtXhuDMEX4WcxzBYAuLiE44UoxjjEiFelNA/MY0cFHVj48pME9fSr35jrMFE tSuyPw2CTDTdDIuy2+baTjYoz/wY8tQa6exgABVRCswBJrn+hjSwzUZWXny19wggiVrw ivQTLxairGocBLde57e2olP4slyQ5tt92+sSshb63VLs1P9CrtqXtbWWE4wQEonyL86d uOhNhNe3NpndX/wFly+2qibRgAe2Q1QOjFOJNAJ6S1weKBl9tZmhscVg489lt3wLn8wB IlD2/WxJkMUZ/Nvsb6yivdGf5ni3Beh+AXoUzorwOrU/794T4T4gKoxVoQDad1XkunUz wRVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=FHJbv/IQitHrDrqVV5Zv3feuTlL4Ima66irM/2+LBrM=; b=HOwHZstjhE16lUWjLp/2lttJGOgY32HxCqFk0EL1qiZa1Di7L+JHLJGOGkiR7lI4NI 3gR4KxzXrhxCrk5FcNeWbnHT/kyIsKX4neP2RVMc9QT5nksHIbPqMoAWJ/jLp2YGUpBX 0OeVUt8LpUlL72UcX85eBvJNceSepR7qIrXWkX4Z6SNwMYVTbxJkroHguLPjvFiD5WOG N2BYYHaT5u+Enu34CV5QVN7yr//bByNXxSvh+30sAWN/gPTg1aC8S1MQCyhLUbZx2Dde s77IsdpRYVpoYDorJELfKPnzp9iq3++KSi+1PffalId1Y0gPEDTC7Kzf3EbQZsn5b63A 2riQ== X-Gm-Message-State: AOAM530X5Ps9lMuSg7NBPIW+jK+1v5moWrILhjOiQm9olxqWnsDS84ak /iR8/RYLI4mKPCOQjx2RQCWFZTwL4KoiFZ/cS5I= X-Google-Smtp-Source: ABdhPJwfgFOcLFg9DksNl5+x+5Ik41PWFI2fJWyTU8ahVjM+/AOUwJrkCCQX7ndFdpkYHpBGBfgJrt3sQ6pNyQya1sQ= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:c931:40c9:b7a5:6cc8]) (user=samitolvanen job=sendgmr) by 2002:a17:90b:1b46:: with SMTP id nv6mr5948244pjb.45.1614883547630; Thu, 04 Mar 2021 10:45:47 -0800 (PST) Date: Thu, 4 Mar 2021 10:45:44 -0800 Message-Id: <20210304184544.2014171-1-samitolvanen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [PATCH] KVM: arm64: Disable LTO in hyp From: Sami Tolvanen To: Marc Zyngier , James Morse Cc: Nathan Chancellor , Kees Cook , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Sami Tolvanen 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 allmodconfig + CONFIG_LTO_CLANG_THIN=y fails to build due to following linker errors: ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21CC): relocation R_AARCH64_CONDBR19 out of range: 2031220 is not in [-1048576, 1048575]; references hyp_panic >>> defined in vmlinux.o ld.lld: error: irqbypass.c:(function __guest_enter: .text+0x21E0): relocation R_AARCH64_ADR_PREL_LO21 out of range: 2031200 is not in [-1048576, 1048575]; references hyp_panic >>> defined in vmlinux.o As LTO is not really necessary for the hypervisor code, disable it for the hyp directory to fix the build. Link: https://github.com/ClangBuiltLinux/linux/issues/1317 Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Sami Tolvanen --- arch/arm64/kvm/hyp/Makefile | 3 +++ 1 file changed, 3 insertions(+) base-commit: f69d02e37a85645aa90d18cacfff36dba370f797 diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile index 687598e41b21..e8116016e6a8 100644 --- a/arch/arm64/kvm/hyp/Makefile +++ b/arch/arm64/kvm/hyp/Makefile @@ -11,3 +11,6 @@ subdir-ccflags-y := -I$(incdir) \ $(DISABLE_STACKLEAK_PLUGIN) obj-$(CONFIG_KVM) += vhe/ nvhe/ pgtable.o + +# Disable LTO for the files in this directory +KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))