Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp930036ybt; Wed, 24 Jun 2020 15:07:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkuBRA3nA/onIOE1dmKIfDdxzAxMNx4ayvot1GDz/5SVQERObcUCcXBVmyspxzqeZaqYrq X-Received: by 2002:a50:a721:: with SMTP id h30mr29138040edc.153.1593036476120; Wed, 24 Jun 2020 15:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036476; cv=none; d=google.com; s=arc-20160816; b=tEO7pEFauQLanIjqh9jlGjt31QJe90TBLGlz99o7nIz3CNEOFo0SF5o+wKp/LRA9x9 uGUNQxbYlNT0T8DMKUjWCu4gH2yTCaD6Hzn7Kc26yAxE3G4829b8qQIKbmwbcwf/PtvE F64SnyZ4gEc3o+ADTZvYEEMlb5MP/gRxRuyTfD7QHjMIePQTzagWI9yewVvar32iwTRP 4MEPPG5LMA7sBCOHdc+YUjHvxKQHM2TXRFP3woVQDJPaImTgY1UADG6dkv/wvvfZWDEP kTUOIADX1GK6W/tv7dr5kdp9zr+tNJArSMj83ucd/ZbkIb7WzPeyuQwPaYQbTzAgdlKW bDzA== 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=9J2CZUP48fiuDe+l15O7PqgQWB3mKCPT+APYGkolERE=; b=Oumryz2jSol+bC1H5XzgAlS2bEjZM7JrlhH/Ax/krIbTlaiCbIPmW5533iG8e3gCKx j4YV/XU/ycVo1dR1L3yptUTldJ+i20UsCo53SNdjVYqBAZi7rqLPYIwyztlHfo0q3xtz s5Hs37MhoDycXiID/qrz4UzQsJYWQv192rQASZVqvBmvdYuuX5sXEA0FwPZ/UOporonE A6oN/A7xhX8fmxu5eGXQXRzT2JqQnRhyuQNrKMLSbNvKWe9T5mr2K7evFtKyovUuXXxi o0sQdQom2d6HWBEzuYNiHjaVUxj/COuV9q6LuFI+sljS+OoNEksbZ0nmFrkCfDSd+R4q aiHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=U3zcce4R; 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 d16si13396935eja.32.2020.06.24.15.07.33; Wed, 24 Jun 2020 15:07:56 -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=U3zcce4R; 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 S2404999AbgFXVtd (ORCPT + 99 others); Wed, 24 Jun 2020 17:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404965AbgFXVtd (ORCPT ); Wed, 24 Jun 2020 17:49:33 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF66C061796 for ; Wed, 24 Jun 2020 14:49:32 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id s14so1684251plq.6 for ; Wed, 24 Jun 2020 14:49:32 -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=9J2CZUP48fiuDe+l15O7PqgQWB3mKCPT+APYGkolERE=; b=U3zcce4R0BFZQpBMXUia0L4rUmnNxJL6RRN0I2qT8KyRFHOUyab+3sv5FvK7Q+xQT6 BfXPRGjflDr7UeiF3S5kP1XPOkiAWEVZZ/sDu+fq3VlegLJ+3XLrquIZWjn7ayWkYCzD DGlm9hqV04oeJ5pt1TWn2smpfobQHkJ+60DVMifOj5Dgwdf34GqiNbK4bIibj5IwSOzY okUcH/p5gUNVj1kjU2l3JaKAdYw5JsvwR8Hv2An0RNPw4VAHR44NH77iLSgJAsOZJFW9 jBx989iScWXwNiWoAxg5iH7/axM+9HKVvfS/FqN1YlndNZjL6GijGhSrKxkAPsx47LD2 ZwEw== 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=9J2CZUP48fiuDe+l15O7PqgQWB3mKCPT+APYGkolERE=; b=phP2ZgtXBcqAJz+en0fbtrCKS3KicGIBE4ZX9HVDf26yN4q3RGlkkiY5u465CHsLBD ryhM3irbnhuXE1TNTRre4u2vViJgfLRSR0fFni8MDsaZC1UkBIIOL1bO4W2TYpqzjJOE vmWVCsZRKNFOzruE3oMdNr4DJSEcL6L1ZpQtxuffCHgkUL0N32kw4591ijaYZGaFzRDH A+Sfs3fA7HvCHqwuhog/I+htX4AD9W4tWz6dPTiyaouRiK6YDpGdO6UZ3ZAq1NEJfvVy 9y1axLwEQAn9ywDmq3dIlF7CeMy2IfqaNlKcbZvb98l/R+3AiohoK+tPB1J03fWdT1wX t7Mw== X-Gm-Message-State: AOAM531IADWn2XKryr9dsHhNhe7Q4XcG9JreIewbBjKa91T2jlNhwMW5 FstqHWGD3tNfFW73V8YrTArtVQ== X-Received: by 2002:a17:90a:a406:: with SMTP id y6mr32616295pjp.216.1593035372032; Wed, 24 Jun 2020 14:49:32 -0700 (PDT) Received: from google.com ([2620:15c:201:2:ce90:ab18:83b0:619]) by smtp.gmail.com with ESMTPSA id w124sm20560279pfc.213.2020.06.24.14.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 14:49:31 -0700 (PDT) Date: Wed, 24 Jun 2020 14:49:25 -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: <20200624214925.GB120457@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-6-samitolvanen@google.com> <20200624211908.GT4817@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624211908.GT4817@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 Wed, Jun 24, 2020 at 11:19:08PM +0200, Peter Zijlstra wrote: > On Wed, Jun 24, 2020 at 01:31:43PM -0700, Sami Tolvanen wrote: > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > > index 30827f82ad62..12b115152532 100644 > > --- a/include/linux/compiler.h > > +++ b/include/linux/compiler.h > > @@ -120,7 +120,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, > > /* Annotate a C jump table to allow objtool to follow the code flow */ > > #define __annotate_jump_table __section(.rodata..c_jump_table) > > > > -#ifdef CONFIG_DEBUG_ENTRY > > +#if defined(CONFIG_DEBUG_ENTRY) || defined(CONFIG_LTO_CLANG) > > /* Begin/end of an instrumentation safe region */ > > #define instrumentation_begin() ({ \ > > asm volatile("%c0:\n\t" \ > > Why would you be doing noinstr validation for lto builds? That doesn't > make sense. This is just to avoid a ton of noinstr warnings when we run objtool on vmlinux.o, but I'm also fine with skipping noinstr validation with LTO. > > +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. Sami