From patchwork Thu Sep 3 20:30:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 11755023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1050A138E for ; Thu, 3 Sep 2020 20:51:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 CFC242067C for ; Thu, 3 Sep 2020 20:51:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EdDZ/DPa"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Mn3Q4z3l"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="iQC3MXcn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFC242067C 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zlQHfyKETZ3gtZ73MGVIB7dMm4U7GoWeMSoVq9seETs=; b=EdDZ/DPaUZJT59jzujPBd5ZYU 6p0aJXEy5FB1as6ETyP1OMKZdjhBzXIWNj9KkjR05BGQMYi9vc/v/tylsoh5c0IOWInu50hJPQiPo IPE03xokzwi2Uc/FqfCEBMxzQf9SJW7kM5SMPTMO1LSAIkxysCeTm+DfCk5+zrkEEY0/rg/J7rgcl q3amWDlNpc4RKKg3MS2Fz/rnkYdGFtWA//4k87vvHv2Z9dMvCD26r1xmL70JiP9YuDdVpWfl9VDkc gnd4PuMqoCA6bIdgeJjyjKfWgO2Z1O6u0X6Zj3/HfEg1q64fmtZIfJeiiqJTphwFwFNbH5pjDtT2T EbCQQTf0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDwCW-0006KG-5S; Thu, 03 Sep 2020 20:51:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDwBe-0005lz-1r for linux-arm-kernel@merlin.infradead.org; Thu, 03 Sep 2020 20:50:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2NV0P0BZEhFeVXK5NU1s/CPB7b09hharJKRKaO0KUAA=; b=Mn3Q4z3lN9UOCvATxYBoR07PLu nVXIV254IoKJcBUiTSkt6combjE19DXdNcF43geP3/XjHmx4AY8rnoJpiejXZIufaSMxLXlTytjTg NZGAFLNqQqYPcHh71xU39m4wNq4QL47EOw3MUozfWMTb08U345/5rkmi17O/F+xkbO3ACB+S72mIp dT4KVLMA18F+G0mI4tpeNHO2J0Ae+9678CSL/P1gXseVxvXkT0l2+B5IQUZ1gRxYv/YUyngHm2gpn 3ETr7/X2y9yY/moczE4pYBW3+OFAQbaDdAYmsh+TFcaSlDu3CGnxTS9uAZmvkq0JNEe/sXmLL5wMh xKGHAw/w==; Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDvtd-0003rm-B0 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 20:32:00 +0000 Received: by mail-pj1-x104a.google.com with SMTP id x21so2157860pjp.6 for ; Thu, 03 Sep 2020 13:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=2NV0P0BZEhFeVXK5NU1s/CPB7b09hharJKRKaO0KUAA=; b=iQC3MXcnnX2MJeVDml9r32koVHGM9fCnhlqFyGQpI4kg6N+GAVi3eGpcReIyaQtftv +8hQOVada7+yAvDv+aDU/EX2lefZWBlI9dX0gvIJ8Kui/Wbd4nfao83zED/RIwUOKlUV gA5DFOuDkiclAAdzZ1/RROkyKMSuawdisMFROE1LrIYELe2IjMVIt9K4CTCeZdrJwu4h 7qDCOjod/u5pLmt4qqLI/ZOb622Ix0toxovXCmz8FD3st43YIbEjbKdrQpK4ZVWgCZs1 02Yx3hYWMaTbxLOVDZUON1042qKsUxlBQ0eLPqPtOoYsRyCMeWYMt5KLAQ1gBbndPuHD TPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=2NV0P0BZEhFeVXK5NU1s/CPB7b09hharJKRKaO0KUAA=; b=o7hzIgTbF/Q8bBz3zvoCdZZrltcRKDp0vLM4RN664g+UJDikHPg/5zjwKEsdVM1O/5 J8mzVh3Vta3iR7JepAII2ZIDngJJ3w4mpGRLtsNQoTKfBMNPTQEAVylPqps61b9b37+D EjwY4iU8kbBhKpwI9jB5NUwiEwJCbI8zEj179djzBfiuR7P8t/neeYKQ0uNxMHj98+2g YBxAPBI4tavfATjwP2TneSgxbq1rGdP2HEmovyjfv//WaatDWoIN5kmTodPTzjOSoJAl 2qR5avY23oj8HdOvMH7PleNvfPVKvzKE0nRdUCUbB2L4epPxz9pRsFuMppRokh6AXST3 F+NA== X-Gm-Message-State: AOAM531zWJo2fKrsItULu2PIOA+jHPbXuFu1mQB0d49ONXj79OfqIpd/ OSSmAXt2vVPYzwDFTvmjfuIWGPipS5qoErA/3Zw= X-Google-Smtp-Source: ABdhPJxXEiK8iQgluE8U1P9eVcF55qIItGQI+hRRjVeMXkeZ98njIjZMcmdWbshQtzwoU58/viNSLC1erEh/riMVVr4= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) (user=samitolvanen job=sendgmr) by 2002:a62:e107:0:b029:13c:1611:658b with SMTP id q7-20020a62e1070000b029013c1611658bmr3713577pfh.8.1599165105298; Thu, 03 Sep 2020 13:31:45 -0700 (PDT) Date: Thu, 3 Sep 2020 13:30:49 -0700 In-Reply-To: <20200903203053.3411268-1-samitolvanen@google.com> Message-Id: <20200903203053.3411268-25-samitolvanen@google.com> Mime-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> <20200903203053.3411268-1-samitolvanen@google.com> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog Subject: [PATCH v2 24/28] KVM: arm64: disable LTO for the nVHE directory From: Sami Tolvanen To: Masahiro Yamada , Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_213149_469590_64583528 X-CRM114-Status: GOOD ( 14.37 ) X-Spam-Score: -10.1 (----------) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-10.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:104a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.5 DKIMWL_WL_MED DKIMwl.org - Medium sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, Kees Cook , "Paul E. McKenney" , kernel-hardening@lists.openwall.com, Peter Zijlstra , Greg Kroah-Hartman , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Steven Rostedt , clang-built-linux@googlegroups.com, Sami Tolvanen , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We use objcopy to manipulate ELF binaries for the nvhe code, which fails with LTO as the compiler produces LLVM bitcode instead. Disable LTO for this code to allow objcopy to be used. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook --- arch/arm64/kvm/hyp/nvhe/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile index aef76487edc2..c903c8f31280 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -45,9 +45,9 @@ quiet_cmd_hypcopy = HYPCOPY $@ --rename-section=.text=.hyp.text \ $< $@ -# Remove ftrace and Shadow Call Stack CFLAGS. +# Remove ftrace, LTO, and Shadow Call Stack CFLAGS. # This is equivalent to the 'notrace' and '__noscs' annotations. -KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS), $(KBUILD_CFLAGS)) +KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_LTO) $(CC_FLAGS_SCS), $(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