Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp673569pxb; Wed, 18 Nov 2020 14:11:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy50JHVyrhf0bV8pXcQDxE0J2OM6kRZslt/CDl1bXIkA1J9rD3thIcL71JYXncV5LQMXn8k X-Received: by 2002:a17:906:f744:: with SMTP id jp4mr26679915ejb.122.1605737503178; Wed, 18 Nov 2020 14:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605737503; cv=none; d=google.com; s=arc-20160816; b=AfEtejovLM/um8csHsUS3ze6z16YXCRBmXx6/p/y8rMzR1Sz+0fXkA7MqnLEKBo2bq xFBEJXN2roR8oQSucdz7lrH87y12WpojjzSP9ZzFzgHwWTYu20eJh7FJKyjMAlK9TvjF dHGvZumJMzo+Y5m5Ht/SnxrtM0PAwgS1WfUloJgWKEWlHkgWPkyZY71bvSnklhh6dVpC PpbQlFI0J2hLtYAQOTQVwg9mOPlu6cuUdYCH68m1ARTygDbN7X0r8LRlRNWYHdqtphLD JF3YERyYdTETnXh/hNwiwYMrTbgrlJzbbNETvrVCmW2xoYvUCynVpHQlZPeCPJzOsaSm xXCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=Nlv9TtNsD8fyGZu3R87XXmbB0Bi+xxOBLxznH5wjST8=; b=CTIOHxu0qOBrGK5SS8h3buXZuNbW/Q5xRo+ohdgoLun4EMXYq3Fmk+Lte25jBJVPEf xV9tEeYj+SGdUsXgk/Gs+S4/nEXDy+VxXLbzrFamDnx7cJ6AzrOefsgIQNQpz0t3YTkQ Z24GCjzkl+RtWqbEXq0EwPur8cBQAQGRvl1lcZ4E2Sy+ZenSlGOjEQeG6RXENK/XQY5e jTJmmVkAde3UToaYvSqnKRh+US2edfVDwD+jPh1InD6jBfssMJ31BAs4t+bPprHwDCiQ XqRaDaye+Kdq2MOlSTAKuprekCqvCljohVwtz14Eapi7jzU0cF3D/YAL0D4b1CdZrVkc q0Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Wyirgobu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si15746821ejg.375.2020.11.18.14.11.20; Wed, 18 Nov 2020 14:11:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Wyirgobu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727552AbgKRWIO (ORCPT + 99 others); Wed, 18 Nov 2020 17:08:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbgKRWIK (ORCPT ); Wed, 18 Nov 2020 17:08:10 -0500 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC67C061A48 for ; Wed, 18 Nov 2020 14:08:08 -0800 (PST) Received: by mail-qk1-x749.google.com with SMTP id d206so2786481qkc.23 for ; Wed, 18 Nov 2020 14:08:08 -0800 (PST) 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=Nlv9TtNsD8fyGZu3R87XXmbB0Bi+xxOBLxznH5wjST8=; b=WyirgobuLaISXur5OETz3eZnFCLE1kF2NBpqHWeIkDujjqI4PTHmgyyXAb1sNUuHVN Megmr6usGQTpCjvxunY6g475SVXL5PIUg4xn4wNAXU/O3G5axjtfvi1UZNaKLuLRYzl+ H7vQeuVy+SxuGDx4D44bti70PiBfA/Fc3fj5gR5ZBA0IAjFSuTDfAo6x8m+qBTUa+FN4 nVGzOamtnPS4n9xOnes8ikNN+95nJ8r8jDlDMPEu/u6I87rrC0kQZtn7FOesX7zgskpv 7cU1bdPWutzDBqXdefcq61dRpBvIzgZAnfJAtbylX8NSGb4UV73Xo8c5A2fqUr0JVzRi d1yg== 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=Nlv9TtNsD8fyGZu3R87XXmbB0Bi+xxOBLxznH5wjST8=; b=DwaE/hWzF1FEVvCwNc1FkRID9Owybe2vYRIDCkxPcDK3dloxc3CKB9Rv6zZWONaVnn qG1U5K4MGOj6I2QU2PMFItN4Drzv0Yrzn/7tO0Pc5gMQlR9s1alvbymWnvw2BJ0G4BAS iqt8bD01i2olFncFx12JaHFd/4wAnMJYZYcXgO0H4NLS0V1OQh1bg8z6E/jKnPtzR2KY ppi6DxgBCtWs9y/BwqDTsMHrkQWiFywkd0LOH2FG6/3f9aQaRmNdfnEZIGq0L7qTVgNb 5mWYzI52mj6BEXoW4UvmnueFXirZ0hNQuLOn2PkFG7GMYUkrfo2wNFkA5jcPR1Q2TtyP jAJA== X-Gm-Message-State: AOAM533inzoJQ/UL0SHgXiBsnkyBwOw3wLzt4fF1mpgqne+oBu6AQi3O tcZQMEV4HNRfOYSvAH0kn385qX4tnlvDM8Q2WhQ= Sender: "samitolvanen via sendgmr" X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) (user=samitolvanen job=sendgmr) by 2002:a0c:b65b:: with SMTP id q27mr6722891qvf.8.1605737287989; Wed, 18 Nov 2020 14:08:07 -0800 (PST) Date: Wed, 18 Nov 2020 14:07:29 -0800 In-Reply-To: <20201118220731.925424-1-samitolvanen@google.com> Message-Id: <20201118220731.925424-16-samitolvanen@google.com> Mime-Version: 1.0 References: <20201118220731.925424-1-samitolvanen@google.com> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH v7 15/17] KVM: arm64: disable LTO for the nVHE directory From: Sami Tolvanen To: Masahiro Yamada , Steven Rostedt , Will Deacon Cc: Josh Poimboeuf , Peter Zijlstra , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 ddde15fe85f2..4ceed7682287 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -51,9 +51,9 @@ $(obj)/kvm_nvhe.o: $(obj)/kvm_nvhe.tmp.o FORCE quiet_cmd_hypcopy = HYPCOPY $@ cmd_hypcopy = $(OBJCOPY) --prefix-symbols=__kvm_nvhe_ $< $@ -# 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 -- 2.29.2.299.gdc1121823c-goog