Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp877863ybt; Wed, 24 Jun 2020 13:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNU+2z/Uafv8UIp3uxVQlyYUH5lL4tUQsyqS28zay5TzCa4ikDjfusv0cpnfdVf4RwC6NO X-Received: by 2002:a17:906:538e:: with SMTP id g14mr13350645ejo.300.1593030900311; Wed, 24 Jun 2020 13:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593030900; cv=none; d=google.com; s=arc-20160816; b=NDzf7Iyh6st+5uCP4bCx9yfNVbrS9ZitxF79Cs8c7pEv6/KA4EPDGBVq7f4Ya/DoPL 1JkB3B17iqgc+yG4blElNlVyS3oWfV4ZI/K2AkTM9J1tscM3HgdaDq9JelxPEu1pfx/E nL8zZAClkA/MT5/83uj0cXiZuaxWHnNrTr1z5swsU5gWh9yQkJlmBxusVhf90F9TMjtI DvLiPryw/+qLygTj6uv9gH3eZ697b8EvnYcTSTDwNP2PG0pBWGxPKqjfYLg0Y+0MohPH hfhmgKt6ASt+lOSZLRFFv+k37G80ZkM2RGrWIWiOvRthibybbzlpgjFzqIYSTS3V7Vwi Zjrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=A7cPf0bNRtzZYfE1vc1rDopHSIr0k7cT2ZUm+OLZjv0=; b=BbXNzRKvAxjXnpQ5el+XmLB6svLGqVWHRmbBptDudFhQxnS2FQzN3jzXRxXFFET2m3 hamGKFwN3+S8RUDSuZnGXk0lx4vGgjs0W51BBoT5hy5x7R5rBLBS6uN9HadItyIxGD8c WdDEUsvrNEVdw6zAiHMU2lAt3IUSV/wBH3szoYTIf4Gvzrhq9ayjINTWCy0AGJYcQi49 JCe6vQ8V0jhlxLnkjhl4TO0mcmJgbNVlS++yzhWgC0PmVUqYaamfxhI/ZmbkmXAkn1AM ca64Me6PwhOwvag1DtxaXsdgZ+IXGRQYhYg7M6s8FpkU32kqriqV6g5dUYRx8VWDBQ7y NpEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QdroIDfh; 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 l11si13670676edw.591.2020.06.24.13.34.36; Wed, 24 Jun 2020 13:35:00 -0700 (PDT) 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=QdroIDfh; 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 S2406639AbgFXUd5 (ORCPT + 99 others); Wed, 24 Jun 2020 16:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406590AbgFXUdf (ORCPT ); Wed, 24 Jun 2020 16:33:35 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3F04C061573 for ; Wed, 24 Jun 2020 13:33:33 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id e4so2429501qtd.13 for ; Wed, 24 Jun 2020 13:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=A7cPf0bNRtzZYfE1vc1rDopHSIr0k7cT2ZUm+OLZjv0=; b=QdroIDfhWPMl7iB8nPdG8F9r+Jm4224Qh0WRTBS1efFhFRpvTdOpw1Wqlz8qn+FYQH CFYve9pYyAVcIOznwtpq4QOlb+uiIUyfq16PYsXpTvWntxsZXcxPZ5lIUBkOt4NXo1Sm PFaSdzav1KtGvpCE5Ob7mVSvukaW8AVYgaIRlUr52jjyj1zFJ6R084rNzCDR/va5Iujh UoakKiURAbGW8xR0S2+Nw0cEeLy4uPMRYJtFclzKSks+5zyjfrBf44Qy3NgDTq9URhoR JWQuukFmtbdz9DrqDBlQZj0VkdPwnrqlxkdn89XzL10tIPUOY5/Zz6v6QbMuu+nDt0wT e8dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=A7cPf0bNRtzZYfE1vc1rDopHSIr0k7cT2ZUm+OLZjv0=; b=PHEcPhUsmQhBX54aHTSNvTTix7W+KadUu/eflJnOyMoWYMWcyJ9xfxBWUnOo1p7OY7 uzyAHknM3NvVLGVNvqb9Y9RLcaewbxd8Z4NJGOZwfypurkryz2HzV0hnF6BfN2H0cB3y 2DIxYOXSkhVB8SIknk4Xf471odDu2emZ8dlun0zV6ZTUP9pu/oDOLCP8+EZU30omS/Kv D6PlWG3Ebxj8jZ7FsemCUT9VFe4S8LuQ4xsKbeBxrQTbTORy7LOpBgJPBeElo6+me1da lpimdGFPW8SmVtdRH9tgvc2djPqbVsR5mkQYyY+5xSin3GrSKzqJf1vEyS22GHZuBgc3 I99Q== X-Gm-Message-State: AOAM532g9R/VE5u+rgTEhldYRppH/EAmMuvGk0qyYTjyCTTLzxXGKhki UHBS5uLcfEjwuOEAkvCkIHRNNT+ymTipxvQZkZ8= X-Received: by 2002:a0c:fcca:: with SMTP id i10mr21455652qvq.150.1593030812853; Wed, 24 Jun 2020 13:33:32 -0700 (PDT) Date: Wed, 24 Jun 2020 13:31:57 -0700 In-Reply-To: <20200624203200.78870-1-samitolvanen@google.com> Message-Id: <20200624203200.78870-20-samitolvanen@google.com> Mime-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH 19/22] x86, vdso: disable LTO only for vDSO From: Sami Tolvanen To: Masahiro Yamada , Will Deacon Cc: 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, x86@kernel.org, Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the undefined DISABLE_LTO flag from the vDSO, and filter out CC_FLAGS_LTO flags instead where needed. Signed-off-by: Sami Tolvanen --- arch/x86/entry/vdso/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 04e65f0698f6..67f60662830a 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -9,8 +9,6 @@ ARCH_REL_TYPE_ABS := R_X86_64_JUMP_SLOT|R_X86_64_GLOB_DAT|R_X86_64_RELATIVE| ARCH_REL_TYPE_ABS += R_386_GLOB_DAT|R_386_JMP_SLOT|R_386_RELATIVE include $(srctree)/lib/vdso/Makefile -KBUILD_CFLAGS += $(DISABLE_LTO) - # Sanitizer runtimes are unavailable and cannot be linked here. KASAN_SANITIZE := n UBSAN_SANITIZE := n @@ -92,7 +90,7 @@ ifneq ($(RETPOLINE_VDSO_CFLAGS),) endif endif -$(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL) +$(vobjs): KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO) $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL) # # vDSO code runs in userspace and -pg doesn't help with profiling anyway. @@ -150,6 +148,7 @@ KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 := $(filter-out $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS_32)) +KBUILD_CFLAGS_32 := $(filter-out $(CC_FLAGS_LTO),$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector) KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls) -- 2.27.0.212.ge8ba1cc988-goog