Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1658443pxp; Thu, 17 Mar 2022 13:49:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIBCxsxA9SnIo+VWX4SO1f3g9A8B4Bje1ZoUvCA8iYjbzvNmlCqvs2wW3zFg5yUbUm7Gw1 X-Received: by 2002:a05:6a00:848:b0:4f7:ba8b:4429 with SMTP id q8-20020a056a00084800b004f7ba8b4429mr6712428pfk.4.1647550161491; Thu, 17 Mar 2022 13:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647550161; cv=none; d=google.com; s=arc-20160816; b=FzEzpl3bMgN9dbcwmZD+eR4PJgrRmnbzEcmB0FIPP6LBKuu821med6Wsjn2FE3uOMo 6rO5mhOx9v/YCcO3+HCr8XjtR6taiEIXXoBfMGY6dIrT8haWn5STmdnmndS9ZhZcpoqM 4D6T3MZI9Sk+Vbf59EP+0VMpCVUwO567PBU770LuAE7BzJAb19g7BnVBfQmJqZ60Pc+J VtC0/uB9R5a2jSJZ06iKuTaY9OGdGpeGG9yh5KLSOyG1Z0TG5MLACHQwXZOMB858417v CfrxttNx7HXFHq9pmE53kj0oqEvaIriTaGrd43Lp4ehci13a+Gl+12iG5ImNFWCDsKxf POfQ== 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=ryH9ljonsXytXG2DnUpgXWcY+PPBTH4gQXM5AkXiazw=; b=r1+KGoKGbm3KacmIHQmk501s7cfoo0ytKykPDibk9WA13i79Lvbo/mKw9RGkBg3HCK +j9Z6ToDZscfWzZQi5g9fYR4wH8Dh9eoSGOgelXE6ljda0/9VeHsJ176DUn0jOO26BJ8 7BvwBDBssl0qMRmQhpnoDrbNG1w2I9rn7bGpc741Wym+BSB5uRRzyblo+iFfp9Dq4afD eV2plqj1tDTy4HDyyumFw4OuNF4TjVxIYS2sPInFZZsbBziBDhhKrrbZgGUOp2LcKN0s ZsxsX20scsFA73Sv/CW9cVYKxDbvtPnFC65TBSPVBn/rm43huxFAVmiQw/tanHzQhKWW 651g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=QR2SAarM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f20-20020a170902ab9400b00153b2d16632si131562plr.570.2022.03.17.13.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=QR2SAarM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5177016F6D9; Thu, 17 Mar 2022 13:13:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229542AbiCQTx7 (ORCPT + 99 others); Thu, 17 Mar 2022 15:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiCQTx5 (ORCPT ); Thu, 17 Mar 2022 15:53:57 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A435282561; Thu, 17 Mar 2022 12:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=ryH9ljonsXytXG2DnUpgXWcY+PPBTH4gQXM5AkXiazw=; b=QR2SAarMkc0tFPFJAN70d+qhN4 eDSnM7lK3VRDc2q6lVgueIZIot+09iAue20w+oOwmUioWTvAJl9NFboeA1CSAbuP9dNBXepQhpXws jR1gJO7mi2VgfuSpy8KqY0svssuuAfmHDwWiCbG5FVuFfv6u/Ovp2TJihuIlCaMXx072X2Tge252E gihu/eVUVPyfwCMizEjIZ8/3Cjs5DkwefRYC4UJaduIszCes77HwUucLC2LCZRKeOchlb2unfvrzI V872oL4UxjwApro9n0ncBxmLcf1NCd2iYRGsps4mgKNBpKxP54bi0EY/3zIjNXvV5IxnO53f9Zzcg 4+/T3FIw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUwAR-001z0Y-Eu; Thu, 17 Mar 2022 19:52:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 98B813001EA; Thu, 17 Mar 2022 20:52:14 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6F1043021E88F; Thu, 17 Mar 2022 20:52:14 +0100 (CET) Date: Thu, 17 Mar 2022 20:52:14 +0100 From: Peter Zijlstra To: Masahiro Yamada Cc: Alexei Starovoitov , Kumar Kartikeya Dwivedi , X86 ML , joao@overdrivepizza.com, "H . J . Lu" , Josh Poimboeuf , Andrew Cooper , LKML , Nick Desaulniers , Kees Cook , Sami Tolvanen , Mark Rutland , alyssa.milburn@intel.com, Miroslav Benes , Steven Rostedt , Masami Hiramatsu , Daniel Borkmann , Andrii Nakryiko , bpf Subject: Re: [PATCH v4 00/45] x86: Kernel IBT Message-ID: References: <20220312154407.GF28057@worktop.programming.kicks-ass.net> <20220313085214.GK28057@worktop.programming.kicks-ass.net> <20220315081522.GA8939@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Mar 18, 2022 at 03:15:59AM +0900, Masahiro Yamada wrote: This is somewhat similar to my first attempt, except I thought it had a extra/superflous link pass in it.. > @@ -288,24 +289,24 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE > $(call if_changed_rule,cc_o_c) > $(call cmd,force_checksrc) > > -ifdef CONFIG_LTO_CLANG > +ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) > # Module .o files may contain LLVM bitcode, compile them into native code > # before ELF processing > -quiet_cmd_cc_lto_link_modules = LTO [M] $@ > -cmd_cc_lto_link_modules = \ > +quiet_cmd_cc_prelink_modules = LD [M] $@ > + cmd_cc_prelink_modules = \ > $(LD) $(ld_flags) -r -o $@ \ > - $(shell [ -s $(@:.lto.o=.o.symversions) ] && \ > - echo -T $(@:.lto.o=.o.symversions)) \ > + $(shell [ -s $(@:.prelink.o=.o.symversions) ] && > \ > + echo -T $(@:.prelink.o=.o.symversions)) \ > --whole-archive $(filter-out FORCE,$^) \ > $(cmd_objtool) > > @@ -469,7 +470,7 @@ $(obj)/lib.a: $(lib-y) FORCE > # Do not replace $(filter %.o,^) with $(real-prereqs). When a single object > # module is turned into a multi object module, $^ will contain header file > # dependencies recorded in the .*.cmd file. > -ifdef CONFIG_LTO_CLANG > +ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) > quiet_cmd_link_multi-m = AR [M] $@ > cmd_link_multi-m = \ > $(cmd_update_lto_symversions); \ Except I overlooked this part, where ar is used instead of ld to combine the individual files. Let me go make the change, Thanks!