Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1725048ybt; Thu, 25 Jun 2020 12:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUVyzyxW3B6j9x1rvNAaVlGiIdrNk16ZBdYvjAEZRh2YQqdPSDt8MfRhUfWZsSjDCaUXQ X-Received: by 2002:a17:906:7693:: with SMTP id o19mr29520161ejm.295.1593113597043; Thu, 25 Jun 2020 12:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593113597; cv=none; d=google.com; s=arc-20160816; b=0lwjg2s9glPUO40rY2L/6iqcb/385hZICVlgRb98/t8vyIVh6w4biCk0XG6sKJvmUY 4dJchzzko740wB+S9PZOMka7vG+3KgMB+awhZBX9lFJvWTkMA5izWGh7wfpnbU7A2TnF 1Ju5RU6g617zlxJmZQyvIjidVx8ckOxGG9syLZiSBmuDcDDe4K2kTiqmCAijO/BGXtLD wRH5WoBY1IgYsMtw41iKo5uspY7QERZg6vnF2UMCCaVxMWs/M4apGVCp4fhGB+YHs5x+ ZUlKfXqv6q7xgSxn7laTEb7Q2RpF98rnLYEBitokA0ofIJ2WNaWqe4KfhAjwmTGwI92c n36Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=aiCyaSfPElHdBJ1rU4jQnvBfG3hDID3mTTJS9XuQz+Q=; b=gBf55bbsLQxXz92nlGyxUcARAxuXVxX9Rj+MlTWATc7yCszpgrUlfM28gI/TcYVPDW tmMOY/93G9U9VTC76MIzwfh2Wey25Y2orjN8sTOXdHHzgVKRIWjKq8xTYEfra9q5bvOw U1a0b14EPoYqiQGN3xvvr+3rodhhjmeRB18XIAFINRCx8rz1nvWMv2ZG1/aGNx1b0dEd orMFdtpuhXT7UrPPIUB/PzoSj8bi6ezxACy8hxNMnsWz6jsfeT70c7fpdhPorc9aPP+T vE2gLfJ83pj/dqtRvJOMSlQbJ0fxshThOR0+ViLk2FaGKl6zkXKjOD+jsTh+jwRGmlx6 +ROw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=mDZm0gGa; 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 w5si9873002ejb.404.2020.06.25.12.32.52; Thu, 25 Jun 2020 12:33:17 -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=mDZm0gGa; 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 S2406445AbgFYTc0 (ORCPT + 99 others); Thu, 25 Jun 2020 15:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406116AbgFYTcZ (ORCPT ); Thu, 25 Jun 2020 15:32:25 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDAD8C08C5DB for ; Thu, 25 Jun 2020 12:32:24 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id ev7so3050589pjb.2 for ; Thu, 25 Jun 2020 12:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aiCyaSfPElHdBJ1rU4jQnvBfG3hDID3mTTJS9XuQz+Q=; b=mDZm0gGa4yZbKDGF9rgasIeYxWV9KiHwNiMw4ndiNsCn3uE7R//SGEQLJE3mdDSI9/ HpYkrdPyVuwor8peEnUfcbBGXiofFnd9veTD7NWibiAP8Ve8E8gCOzG31rjOvREFV1Bf JgsOujSu3baR0YmlQhh5NEYw2pxgOkuVQSleeQxner2eUY5rh1bZK2fJ9oTRt0snh+M+ w5fHbf1pXC29S4Vdgqgal1yygHmQF+xISjlsoEB9iBq9A7j/gBZC02UXmgSOGcV/V0l2 EEwNoJRyrtCrwRdjdM5UwbSh/doG0vV/wAS2jKyrjWA8airu6HPV73/rpljmn2VIho8e Lz0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aiCyaSfPElHdBJ1rU4jQnvBfG3hDID3mTTJS9XuQz+Q=; b=nxdIh8rX1PR9Jm0Vp0yqiM6iHssriBlJYuQJkvyVTsKHgP1EkykReDCWaHWrWCNzqh BujMLILa2WoY4X7TQk+5afKS0+p5lTIOUtOhBel7QIT60gNXw3DcpTvwG0JsLY1nkns6 X2SXC8MTbxnvqxt3uaOrSzgY3ysEei4/Et7j/dqBw6eTALwUD2PKMJh0ucEcFxiaHOLi GpPMJfs5A/WSZHkr5E7rGl4Twv6dSmtJ6Lwba3e934jJOoGIzUsSyOtXcbA97JbvPdgi CRA38gFDlxL0Ws9ysuzeugiaz93WEXms9Ix2104xAiyoldo2jEhgOXRv1WR8VyynfpaO 5Srg== X-Gm-Message-State: AOAM533VqTEZjY610Gwc61ejDHvo1zAkwrWsZXFBtZYApKJr4n/vrQMO SnHV1I2MQdzXEt49Ba5bVIoolA== X-Received: by 2002:a17:90b:88b:: with SMTP id bj11mr5103958pjb.51.1593113544026; Thu, 25 Jun 2020 12:32:24 -0700 (PDT) Received: from google.com ([2620:15c:201:2:ce90:ab18:83b0:619]) by smtp.gmail.com with ESMTPSA id c141sm9061908pfc.167.2020.06.25.12.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 12:32:23 -0700 (PDT) Date: Thu, 25 Jun 2020 12:32:17 -0700 From: Sami Tolvanen To: Peter Zijlstra Cc: Masahiro Yamada , Will Deacon , 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 Subject: Re: [PATCH 05/22] kbuild: lto: postpone objtool Message-ID: <20200625193217.GA59566@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-6-samitolvanen@google.com> <20200624211908.GT4817@hirez.programming.kicks-ass.net> <20200624214925.GB120457@google.com> <20200625074716.GX4817@hirez.programming.kicks-ass.net> <20200625162226.GC173089@google.com> <20200625183351.GH4800@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200625183351.GH4800@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 25, 2020 at 08:33:51PM +0200, Peter Zijlstra wrote: > On Thu, Jun 25, 2020 at 09:22:26AM -0700, Sami Tolvanen wrote: > > On Thu, Jun 25, 2020 at 09:47:16AM +0200, Peter Zijlstra wrote: > > > > Right, then we need to make --no-vmlinux work properly when > > > !DEBUG_ENTRY, which I think might be buggered due to us overriding the > > > argument when the objname ends with "vmlinux.o". > > > > Right. Can we just remove that and pass --vmlinux to objtool in > > link-vmlinux.sh, or is the override necessary somewhere else? > > Think we can remove it; it was just convenient when running manually. Great, I'll change this in v2. > > > > > > +ifdef CONFIG_STACK_VALIDATION > > > > > > +ifneq ($(SKIP_STACK_VALIDATION),1) > > > > > > +cmd_ld_ko_o += \ > > > > > > + $(objtree)/tools/objtool/objtool \ > > > > > > + $(if $(CONFIG_UNWINDER_ORC),orc generate,check) \ > > > > > > + --module \ > > > > > > + $(if $(CONFIG_FRAME_POINTER),,--no-fp) \ > > > > > > + $(if $(CONFIG_GCOV_KERNEL),--no-unreachable,) \ > > > > > > + $(if $(CONFIG_RETPOLINE),--retpoline,) \ > > > > > > + $(if $(CONFIG_X86_SMAP),--uaccess,) \ > > > > > > + $(@:.ko=$(prelink-ext).o); > > > > > > + > > > > > > +endif # SKIP_STACK_VALIDATION > > > > > > +endif # CONFIG_STACK_VALIDATION > > > > > > > > > > What about the objtool invocation from link-vmlinux.sh ? > > > > > > > > What about it? The existing objtool_link invocation in link-vmlinux.sh > > > > works fine for our purposes as well. > > > > > > Well, I was wondering why you're adding yet another objtool invocation > > > while we already have one. > > > > Because we can't run objtool until we have compiled bitcode to native > > code, so for modules, we're need another invocation after everything has > > been compiled. > > Well, that I understand, my question was why we need one in > scripts/link-vmlinux.sh and an additional one. I think we're just > talking past one another and agree we only need one. We need just one for vmlinux.o, but this rule adds an objtool invocation for kernel modules, which we also couldn't check earlier. We link all the bitcode for modules into .lto.o and run modpost and objtool on that before building the final .ko. Sami