From patchwork Fri Sep 18 20:14:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 11786271 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 0E930618 for ; Fri, 18 Sep 2020 20:32:23 +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 B730221707 for ; Fri, 18 Sep 2020 20:32:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Kn/f8VWZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="DE3cjPUo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="REd95VnF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B730221707 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=7Rgz1nN+nRwCTWEywv1mUkaHgJoFfHHMQzq2SF2+jIg=; b=Kn/f8VWZKKkSWblEnT+5eZkYp ihguIV7keQrK8hZPpRrqVgU2SGxOl4kBSHF4Tbk3D8juK6jLI7m08htKLFz8uQaRgIM7Qkbz7tr/W wtD6yhLy4Hakpcp7709ee+QvQUUeSdS+3WABV9hqVZUDYCjiFc9/hX5OfuXXcKjQuZharedXcBLyG AjcQ/IQbLzcnX+O0p7j9/vR2izuS7B6aOX3vFXn/2XPw/t2Og3u24BWvmN/UUPCp2wDSFn5ZcRk0U X/LG+fKpd2lEVFsupCGp8gpyst0f7Q2ldzXiIixGL5zHXHBuHKYh+rq5JDi3ppp0iolL840Th1JOM 3q691LtOg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJN35-00076O-Mi; Fri, 18 Sep 2020 20:32:03 +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 1kJN2f-0006xG-Tt for linux-arm-kernel@merlin.infradead.org; Fri, 18 Sep 2020 20:31:38 +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=oXJMXy02LqTQDpBkn8PPtjYwJPq4evUojZhZLMc3uvo=; b=DE3cjPUo4JlJjq5Lhuf10xZLHh EMe1AifdvhdU/Hv23BigjET7WFB5kSHkiXOA2VHM4cm9r0zvmyC/gzqC6z7U3cgf8wEmhBNfj3g5P whd+bMfhkJ+z/DujBYhOutp6EKjYwrvMF125M+OkZS+lTNSB0FZFnaoAzc47FnO+5fKdOc5t2WIn7 AU/qXOATiV7A8+Vw3ngtyTkpIP7fmDHKEhes917M6N0gULpRe1ZvwgP9DMP9YocodGmLi1Ui8uFSG yr/jGnu9dZYpUNBHWu3FAQVu9YDxhbeD8LHMALKro42ZkzQE6Hz/alMSHUvNIfeKywDpol97ZYEIO +uUICwVQ==; Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJMnI-0004yb-FD for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 20:15:47 +0000 Received: by mail-yb1-xb49.google.com with SMTP id v106so6680108ybi.6 for ; Fri, 18 Sep 2020 13:15:43 -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=oXJMXy02LqTQDpBkn8PPtjYwJPq4evUojZhZLMc3uvo=; b=REd95VnFXwmD3ND7Lapf6wTEKHlyfaSDlXa6A5g8OMe6rD7mXFuEioeTzTVuP+wKYy krseyNRuMtJa9ctfWr2TjaEjNcbStkBCBOxYrTttidotv9Qbdv5f70T8rfirifUlhiGO fbpwKXewIVSjSWcELClY8rHyvPgkF2XdC/QZF4KVfiVKi0xCd18r7fnei+hqOeW0nZel JhxqIwpbgtSIJrJ5e9QQl5CT7x9s7Yh2DeXazsVf3ebafU4M8/COaXTHkTmNbs2X65vv uvYLZii0pQgCywSqGr9bhM6Jz3cwSDm+sYfUU2OyMAh4+XaJbe4V1f+DGOyRxBJY+8Ct N4eQ== 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=oXJMXy02LqTQDpBkn8PPtjYwJPq4evUojZhZLMc3uvo=; b=aNhvSLycDsisrmLOttPasMDaD9gMrj7MLDr9Ktz7inBma8c5lErmPZX0nxVBmaXRB6 BKfx4V5VOBU3ANosip/RNb3fTJWlpO35rOhtY6W3qYzu0fbRObP0u7eQRdeSEa7p2lGQ Q0RjtbRfXcChXzJjgjbBdTU4TM370hJyOLUt1Osu1/G2j3ARfVxgHHGL9+RUDhnilXLq dcH8IyRQuk5p3Nk/KDD0oy8ymwOIoqSPe18MYu7vlvrOlwFGUEOSSlm05Qhc+Q4BN/PS paP65wTFE+NaLxVOyRy6sk+RfdjneedV6/Whi8Hbmbr1ddRC2pnGQ6BwHzhjVN50ePHv Lblw== X-Gm-Message-State: AOAM530aC+xZ+YKQyVUia//0vHZ1oQlELJ6hP4zdBnr73ErwS58K+SzZ Wzcr32D6XOQd2hQu1WGxFN/8IMcd3oybS+mTKf4= X-Google-Smtp-Source: ABdhPJxMyDngZuNnNx1wL9/fMd7ntfJVtVGTW6/hjVnBGEbXwyy4OggBNEJrH2U3qB1vnImsc26NsteebpxVgOTzfOI= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) (user=samitolvanen job=sendgmr) by 2002:a25:14c4:: with SMTP id 187mr54928163ybu.449.1600460141424; Fri, 18 Sep 2020 13:15:41 -0700 (PDT) Date: Fri, 18 Sep 2020 13:14:32 -0700 In-Reply-To: <20200918201436.2932360-1-samitolvanen@google.com> Message-Id: <20200918201436.2932360-27-samitolvanen@google.com> Mime-Version: 1.0 References: <20200918201436.2932360-1-samitolvanen@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v3 26/30] 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-20200918_211544_678939_68E7507B X-CRM114-Status: GOOD ( 13.78 ) X-Spam-Score: -9.6 (---------) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-9.6 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:b49 listed in] [list.dnswl.org] -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.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 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