From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF1D1C433F5 for ; Fri, 18 Mar 2022 02:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231689AbiCRCI7 convert rfc822-to-8bit (ORCPT ); Thu, 17 Mar 2022 22:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231696AbiCRCI7 (ORCPT ); Thu, 17 Mar 2022 22:08:59 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68E201770A1 for ; Thu, 17 Mar 2022 19:07:41 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-138-muips4pANZGvgD4JdOOjog-1; Fri, 18 Mar 2022 02:07:38 +0000 X-MC-Unique: muips4pANZGvgD4JdOOjog-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 18 Mar 2022 02:07:37 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.033; Fri, 18 Mar 2022 02:07:37 +0000 From: David Laight To: 'Peter Zijlstra' , 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 Thread-Topic: [PATCH v4 00/45] x86: Kernel IBT Thread-Index: AQHYOjfxkjA80HyQbUOAw96zl/91g6zEYw+g Date: Fri, 18 Mar 2022 02:07:37 +0000 Message-ID: <260c9402b6d647a39b4a5cf51024963d@AcuMS.aculab.com> References: <20220312154407.GF28057@worktop.programming.kicks-ass.net> <20220313085214.GK28057@worktop.programming.kicks-ass.net> <20220315081522.GA8939@worktop.programming.kicks-ass.net> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org From: Peter Zijlstra > Sent: 17 March 2022 19:45 > > On Wed, Mar 16, 2022 at 01:28:08AM +0900, Masahiro Yamada wrote: > > On Tue, Mar 15, 2022 at 5:15 PM Peter Zijlstra wrote: > > > > Index: linux-2.6/scripts/Makefile.build > > > =================================================================== > > > --- linux-2.6.orig/scripts/Makefile.build > > > +++ linux-2.6/scripts/Makefile.build > > > @@ -86,12 +86,18 @@ ifdef need-builtin > > > targets-for-builtin += $(obj)/built-in.a > > > endif > > > > > > -targets-for-modules := $(patsubst %.o, %.mod, $(filter %.o, $(obj-m))) > > > +targets-for-modules := > > > > > > Why do you need to change this line? > > > > > > > > > > > > ifdef CONFIG_LTO_CLANG > > > targets-for-modules += $(patsubst %.o, %.lto.o, $(filter %.o, $(obj-m))) > > > endif > > > > > > +ifdef CONFIG_X86_KERNEL_IBT > > > +targets-for-modules += $(patsubst %.o, %.objtool, $(filter %.o, $(obj-m))) > > > +endif > > > + > > > +targets-for-modules += $(patsubst %.o, %.mod, $(filter %.o, $(obj-m))) > > > + > > > ifdef need-modorder > > > targets-for-modules += $(obj)/modules.order > > > endif > > The thinking was that by having the .objtool rule before the .mod rule, > objtool runs first. If mod runs before objtool, objtool will change the > timestamp and then mod will get remade, even if nothing's changed. I don't think it should make any difference. A quick peruse didn't show where targets-for-modules actually ends up being used (after being added to targets). But in a makefile, if you have: x: a b nothing requires make to generate 'a' before or after 'b'. gmake might have something similar to nmake's .ORDER directive but I don't remember seeing it defined anywhere. You can add 'b: a' to force the order (which is how .ORDER ends up being implemented). But I didn't spot anything of that nature. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)