Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3543262pxb; Tue, 19 Apr 2022 05:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXl2Bw8Jd46IqFvxG9dQ9LNoWSs302VqOJ4ee5BGT6XssmcWLlGaj31okFMvtAAiWPUYys X-Received: by 2002:a17:90b:1a8a:b0:1d2:e42f:9993 with SMTP id ng10-20020a17090b1a8a00b001d2e42f9993mr1858979pjb.68.1650370096350; Tue, 19 Apr 2022 05:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650370096; cv=none; d=google.com; s=arc-20160816; b=aEIiDLCcsiudNIeVqlXQIWxfUBk3dKFU6jtHHzVWXyvIdwX87cZ+YNAn5XFGpYPZ3p JurYaRMwfpfkSFgJ50KsjtDH5jvWmb9bGp5gjOLFoKhepsNgzD+TvbzTz3/TaF3gW4tr aXbluFNyTry+KMlsCMIujPvm7mGR3v59rRDO5trSXaoeqJ7VyMnkA/278a6JmuUbMdTj 27kkYS1ZXGd3VQccgMEjFTNyv9uMQ/oZGvCNmPpLNQM3Av7+vZtJPbXb1bd3c/Im203E DwsTvj2r9zk3wUfHm8t8tgEhMlnDUn7IpolBnNZgkosnMtWiWt0ckuwWAalqB2ZUiBev VeEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=by/avHz0lmt+0CrvyNMfd3ZJgBpesJrRIzEYCC0+J9I=; b=aY7lkvwoiPHfQoddXhazvQLxYMyZhivmFM/WYylA7CYTPOv3UbAga11YM62Sythr5q kgKHMzrW6CWRshs9/hyKZMjrsTPWnhahyn6KGECe5ZDB+hcgdJpxokNbkUcAImyynOWG kvq4N/pH40dC+cRN3MwCM3y6w3WfmXb7lGv53NCS5yCNgs07vshyEUVCL4f6aK0fWTZm f3Eyb148RWU7duy5TbJhfIqx2nzueJJ+qA0XRyJWCb8sHNKwytYrYlNWp9BECg7lY96T kLd5DltCCunAg7netx07VIIWTCbWQClQZBU7aQZLcKhFGjCoQ/QaoNmWngdtFxrLDhSy uUFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EH26emG8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a17090a050200b001c38029e0easi2035401pjh.53.2022.04.19.05.08.02; Tue, 19 Apr 2022 05:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EH26emG8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351912AbiDSLyX (ORCPT + 99 others); Tue, 19 Apr 2022 07:54:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348881AbiDSLyV (ORCPT ); Tue, 19 Apr 2022 07:54:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96AE135A8F for ; Tue, 19 Apr 2022 04:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=by/avHz0lmt+0CrvyNMfd3ZJgBpesJrRIzEYCC0+J9I=; b=EH26emG8dozfwgbLDRHaT6hR0a T5GBynsNsO4tqZPmoBNSfhF8bWZSGePL4fCQcue5FCIl0KRud3yH/NQGLU6WNJMU9Eztb/6kyxqLw VNQhjmseNibEiCY0wtukgVtCAwkdqrsJMFBIs+hl6pTqcbj1CLdEACIOYHRs/CVsAfs9Z6sk1ufvN DRcgp25XHwok8rSIZNJH14q7yaNsII4KTODZMvSAEt1w645mE+XNsrXNDUASaYPx6hbAckSeox4/O P2U1+3sYqmLXx9kjuBzFvXgOiTueEMDxpCDHPEN7H3STTMtoeGc+iqE6SvM2JS8FOFhvsfVyQqkII NnpgE7mA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngmOI-0033rG-T3; Tue, 19 Apr 2022 11:51:32 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 32919986195; Tue, 19 Apr 2022 13:51:30 +0200 (CEST) Date: Tue, 19 Apr 2022 13:51:30 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: Re: [PATCH v2 00/25] objtool: Interface overhaul Message-ID: <20220419115130.GT2731@worktop.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 18, 2022 at 09:50:19AM -0700, Josh Poimboeuf wrote: > Josh Poimboeuf (25): > objtool: Enable unreachable warnings for CLANG LTO > libsubcmd: Fix OPTION_GROUP sorting > x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline > x86/retpoline: Add ANNOTATE_ENDBR for retpolines > x86/uaccess: Add ENDBR to __put_user_nocheck*() > x86/xen: Add ANNOTATE_ENDBR to startup_xen() > objtool: Reorganize cmdline options > objtool: Ditch subcommands > objtool: Don't print parentheses in function addresses > objtool: Print data address for "!ENDBR" data warnings > objtool: Use offstr() to print address of missing ENDBR > objtool: Add option to print section addresses > scripts: Create objdump-func helper script > objtool: Make stack validation optional > objtool: Rework ibt and extricate from stack validation > objtool: Extricate sls from stack validation > objtool: Add CONFIG_OBJTOOL > objtool: Make stack validation frame-pointer-specific > objtool: Make static call annotation optional > objtool: Make jump label hack optional > objtool: Make noinstr hacks optional > objtool: Rename "VMLINUX_VALIDATION" -> "NOINSTR_VALIDATION" > objtool: Add HAVE_NOINSTR_VALIDATION > objtool: Remove --lto and --vmlinux in favor of --link > objtool: Update documentation I've taken the liberty of reordering it slightly: objtool: Enable unreachable warnings for CLANG LTO x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline x86/retpoline: Add ANNOTATE_ENDBR for retpolines x86/uaccess: Add ENDBR to __put_user_nocheck*() x86/xen: Add ANNOTATE_ENDBR to startup_xen() objtool: Print data address for "!ENDBR" data warnings objtool: Use offstr() to print address of missing ENDBR Go into x86/urgent, and I've added Fixes: tags with various patches from the IBT series, and then the rest goes into objtool/core. As already indicated, there's going to be a few merge conflicts against x86/core, but alas. Resolved as per the below. --- diff --cc arch/x86/Kconfig index 20c1dacd2baa,c8f560802bf2..000000000000 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig diff --cc scripts/Makefile.build index 7e7aa1d030a6,ac8167227bc0..000000000000 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@@ -227,15 -227,19 +227,19 @@@ ifdef CONFIG_OBJTOO objtool := $(objtree)/tools/objtool/objtool objtool_args = \ - $(if $(CONFIG_UNWINDER_ORC),orc generate,check) \ - $(if $(part-of-module), --module) \ - $(if $(CONFIG_X86_KERNEL_IBT), --lto --ibt) \ - $(if $(CONFIG_FRAME_POINTER),, --no-fp) \ - $(if $(CONFIG_GCOV_KERNEL)$(CONFIG_LTO_CLANG), --no-unreachable)\ + $(if $(CONFIG_HAVE_JUMP_LABEL_HACK), --hacks=jump_label) \ + $(if $(CONFIG_HAVE_NOINSTR_HACK), --hacks=noinstr) \ + $(if $(CONFIG_X86_KERNEL_IBT), --ibt) \ + $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \ + $(if $(CONFIG_UNWINDER_ORC), --orc) \ $(if $(CONFIG_RETPOLINE), --retpoline) \ + $(if $(CONFIG_SLS), --sls) \ + $(if $(CONFIG_STACK_VALIDATION), --stackval) \ + $(if $(CONFIG_HAVE_STATIC_CALL_INLINE), --static-call) \ - $(if $(CONFIG_X86_SMAP), --uaccess) \ + --uaccess \ - $(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount) \ - $(if $(CONFIG_SLS), --sls) + $(if $(linked-object), --link) \ + $(if $(part-of-module), --module) \ + $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@) cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd) diff --cc scripts/link-vmlinux.sh index 3a2fffdf49d4,eb9324f07f3d..000000000000 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@@ -126,34 -132,46 +132,44 @@@ objtool_link( if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then objtoolopt="${objtoolopt} --mcount" fi - fi - if is_enabled CONFIG_VMLINUX_VALIDATION; then - objtoolopt="${objtoolopt} --noinstr" - fi + if is_enabled CONFIG_UNWINDER_ORC; then + objtoolopt="${objtoolopt} --orc" + fi - if [ -n "${objtoolopt}" ]; then - if [ -z "${objtoolcmd}" ]; then - objtoolcmd="check" + if is_enabled CONFIG_RETPOLINE; then + objtoolopt="${objtoolopt} --retpoline" fi - objtoolopt="${objtoolopt} --vmlinux" - if ! is_enabled CONFIG_FRAME_POINTER; then - objtoolopt="${objtoolopt} --no-fp" + + if is_enabled CONFIG_SLS; then + objtoolopt="${objtoolopt} --sls" fi - if is_enabled CONFIG_GCOV_KERNEL || is_enabled CONFIG_LTO_CLANG; then - objtoolopt="${objtoolopt} --no-unreachable" + + if is_enabled CONFIG_STACK_VALIDATION; then + objtoolopt="${objtoolopt} --stackval" fi - if is_enabled CONFIG_RETPOLINE; then - objtoolopt="${objtoolopt} --retpoline" + + if is_enabled CONFIG_HAVE_STATIC_CALL_INLINE; then + objtoolopt="${objtoolopt} --static-call" fi - if is_enabled CONFIG_X86_SMAP; then - objtoolopt="${objtoolopt} --uaccess" - fi + objtoolopt="${objtoolopt} --uaccess" + fi - if is_enabled CONFIG_SLS; then - objtoolopt="${objtoolopt} --sls" + if is_enabled CONFIG_NOINSTR_VALIDATION; then + objtoolopt="${objtoolopt} --noinstr" + fi + + if [ -n "${objtoolopt}" ]; then + + if is_enabled CONFIG_GCOV_KERNEL; then + objtoolopt="${objtoolopt} --no-unreachable" fi + + objtoolopt="${objtoolopt} --link" + info OBJTOOL ${1} - tools/objtool/objtool ${objtoolcmd} ${objtoolopt} ${1} + tools/objtool/objtool ${objtoolopt} ${1} fi }