Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1202840imm; Wed, 13 Jun 2018 15:20:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKs/jNk+XWfhS65UgKfp8gF6iFHkelnbEjVgyeKkRZRw2VsltK1+l5CjX/x9mZ6FPLsqz3p X-Received: by 2002:a63:77c6:: with SMTP id s189-v6mr16356pgc.450.1528928432816; Wed, 13 Jun 2018 15:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528928432; cv=none; d=google.com; s=arc-20160816; b=ZMZ9spvf9IWATWn3FX2RPhlulas/2qrAnk9zGlPi/g6vmuPrxVtiaz69zGzao+CIVb NBZYShJduR2E3SUNLnrNL2Nee2b39BFn7FIDOgXFSd1CP+ujUho+Hu12rnzsIcPaz1ki r6jIPpYoVsgd4uARZNeJC12CuMb2Lp4z6eoYLByEcz1VnPs3qyVXKdveoSPJtBLeIMLa qujxBQWGYFP25jUHukRcPahWKWERBTttf8nNjBRhO9y8WWJCDQTxd3x5sfxwTUNXklw9 cnxlB5Yh1sLIUKA4Bhg8WedsXEp2ut4OmRzO1ecGlytvPzIs+EAks8KouWfyIqW3P7ue KPBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=+JT4nIJz4c5uI1lTa3Pp9lz6XWnd7OobHGvMegMgXW0=; b=qaQ07pZ/j21rpGEitufqUInM/RWvxNrRJ3szTQNZo/T2TPP92RRRoDHZZDO0sZ9BqE Iz2oJYFkEpLW41AOkEzLHKsepdSBGQp+XulNeFZwZYTP/l0m+5Y7gZipuCH9vEvV9wvS NliAtD/owKE+jlaMozGSHU3CuDPagAHgMsCIvI+aiWqibZ0i7fnZKbeaJqRSLSR+zFYT QwfWYNmNzj/YRd4m0oQptTg60peOppVwkHpJXHKE8AlErVZexXhy8Carbb7VydpGNLHb 5+WuulMZOwqonvvTNtNheFqchGDNEjWVbI0KcsaYxSEXrG0eKGvDixfxKV6QpAJDMVP7 Oerg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=TakE7L+t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si3613064plz.438.2018.06.13.15.20.18; Wed, 13 Jun 2018 15:20:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=TakE7L+t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935872AbeFMWT3 (ORCPT + 99 others); Wed, 13 Jun 2018 18:19:29 -0400 Received: from mail-by2nam03on0076.outbound.protection.outlook.com ([104.47.42.76]:16460 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935384AbeFMWT1 (ORCPT ); Wed, 13 Jun 2018 18:19:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+JT4nIJz4c5uI1lTa3Pp9lz6XWnd7OobHGvMegMgXW0=; b=TakE7L+tk9KYNsM4NVPNFED9iWUDqaOz9FNJ42eKEMsEdqa7XVgPCKQG5szscvAaaGdj+xiuxr/QI9FOPhfOHZaioQway5H+wyTFWEskJQw6/2cM5PbtcYQoYOX5syoUkFmiUpnJ+esb1AILXK3ol9mVjjWTt+qA6uwB0eEOBQE= Received: from BL0PR05MB4772.namprd05.prod.outlook.com (20.177.145.81) by BL0PR05MB4769.namprd05.prod.outlook.com (20.177.145.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.6; Wed, 13 Jun 2018 22:19:24 +0000 Received: from BL0PR05MB4772.namprd05.prod.outlook.com ([fe80::9cb3:7cc0:9f85:b1c7]) by BL0PR05MB4772.namprd05.prod.outlook.com ([fe80::9cb3:7cc0:9f85:b1c7%2]) with mapi id 15.20.0863.016; Wed, 13 Jun 2018 22:19:24 +0000 From: Nadav Amit To: Masahiro Yamada CC: Linux Kernel Mailing List , X86 ML , Michal Marek , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux Kbuild mailing list Subject: Re: [PATCH v4 1/9] Makefile: Prepare for using macros for inline asm Thread-Topic: [PATCH v4 1/9] Makefile: Prepare for using macros for inline asm Thread-Index: AQHUAoBcWQHwkR0gx0yiggpe5MmWsaRedzMAgABM9AA= Date: Wed, 13 Jun 2018 22:19:24 +0000 Message-ID: References: <20180612115050.185112-1-namit@vmware.com> <20180612115050.185112-2-namit@vmware.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=namit@vmware.com; x-originating-ip: [208.91.2.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR05MB4769;7:iPFaehXcXqNEtmtcED9nOxbT1kG0CCXRFJPEPIkOQdpdz1pkX3WR22CZN30larrhdqy5f57y98rs7nFaI1MWmiAH9ypW4ICtjJHIgtBtP64/92zy1jHhUZcoGrHvU9XfN2Lk1HChD6CBolbhGq4JFgwQvHjMGOZ92DbWJCe6pemWCDiHCoCZ2AOCOHThf/n3KiojX2sJOPRl0hmHmwlk8wbVR8z7o9TQSmXw5Jo3rNXbmPXP7QZivjOrailCDi1K;20:ZhIodL9ebDITdCopuVCiXDiID4ptB45QBm+FCLNwQH2UabFyvRNRa4yOL6qWKBaveA81XUl6g7iulDRZ2DHVb4LPACI5Tk4uhwYJPj5BVOpRjlw/rYEXVAU1qCfKIrj7Xv+GMWMWdskolfCyfL0MKASWE5kdtRT40Z+l3JJAVDE= x-ms-exchange-antispam-srfa-diagnostics: SOS; X-MS-Office365-Filtering-Correlation-Id: 7f0b243d-3bf4-433a-76c8-08d5d17bb810 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BL0PR05MB4769; x-ms-traffictypediagnostic: BL0PR05MB4769: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(61668805478150)(9452136761055); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:BL0PR05MB4769;BCL:0;PCL:0;RULEID:;SRVR:BL0PR05MB4769; x-forefront-prvs: 07025866F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(366004)(39380400002)(376002)(346002)(39860400002)(51444003)(189003)(199004)(53936002)(7736002)(6916009)(5250100002)(2616005)(446003)(8676002)(68736007)(6246003)(8936002)(11346002)(81156014)(4326008)(99286004)(5660300001)(97736004)(81166006)(3846002)(6116002)(105586002)(305945005)(476003)(25786009)(82746002)(486006)(14454004)(186003)(3280700002)(2900100001)(66066001)(86362001)(33656002)(229853002)(6436002)(76176011)(106356001)(6512007)(478600001)(6486002)(316002)(6506007)(102836004)(83716003)(54906003)(36756003)(3660700001)(2906002)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR05MB4769;H:BL0PR05MB4772.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: gFAI9Ivcchc5mNqz2zrFA5Avj7r/XjL/XtwGoMicS2aWS34EC5f4RUVC9ciMFe2y0mCRsk1oH1La0Qkpk6wy2f4f2yI+JbPell0ZyXSUy8Xq9UEsVNSH5GpzWrcUl77u3aM1a4cJxEOE/Y3WwiSBdvK5HMpc+K127FQq4rGGDvR2YWcXFnpzGONIX/FKG3Pz spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <7E2A08E6687B074F87E68E9627067233@namprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f0b243d-3bf4-433a-76c8-08d5d17bb810 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jun 2018 22:19:24.0656 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR05MB4769 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for your comment! I am certainly Makefile-challenged, so your help i= s highly appreciated. Please see my responses/questions inline. at 10:43 AM, Masahiro Yamada wrote: > 2018-06-12 20:50 GMT+09:00 Nadav Amit : >> Using macros for inline assembly improves both readability and >> compilation decisions that are distorted by big assembly blocks that use >> alternative sections. Compile macros.S and use it to assemble all C >> files. Currently, only x86 will use it. >>=20 >> Cc: Masahiro Yamada >> Cc: Michal Marek >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: "H. Peter Anvin" >> Cc: x86@kernel.org >> Cc: linux-kbuild@vger.kernel.org >>=20 >> Signed-off-by: Nadav Amit >=20 >=20 > I have not fully understood this series yet. >=20 > I do not have enough skill in x86 architecture, > but just some comments from the build system point of view. >=20 >=20 >=20 > I guess this will probably break the parallel building. >=20 > Kbuild can build 'prepare' and 'scripts' simultaneously. >=20 >=20 > I locally modified the following line: >=20 >=20 > diff --git a/Makefile b/Makefile > index 2dea909440..6ad484a 100644 > --- a/Makefile > +++ b/Makefile > @@ -1030,7 +1030,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; > # Error messages still appears in the original language >=20 > PHONY +=3D $(vmlinux-dirs) > -$(vmlinux-dirs): prepare scripts > +$(vmlinux-dirs): scripts prepare > $(Q)$(MAKE) $(build)=3D$@ need-builtin=3D1 >=20 > define filechk_kernel.release >=20 >=20 >=20 > masahiro@grover:~/workspace/linux-kbuild$ make defconfig > HOSTCC scripts/basic/fixdep > HOSTCC scripts/kconfig/conf.o > YACC scripts/kconfig/zconf.tab.c > LEX scripts/kconfig/zconf.lex.c > HOSTCC scripts/kconfig/zconf.tab.o > HOSTLD scripts/kconfig/conf > *** Default configuration is based on 'x86_64_defconfig' > # > # configuration written to .config > # > masahiro@grover:~/workspace/linux-kbuild$ make all > scripts/kconfig/conf --syncconfig Kconfig > WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h > WRAP arch/x86/include/generated/uapi/asm/poll.h > WRAP arch/x86/include/generated/asm/dma-contiguous.h > WRAP arch/x86/include/generated/asm/early_ioremap.h > WRAP arch/x86/include/generated/asm/mcs_spinlock.h > WRAP arch/x86/include/generated/asm/mm-arch-hooks.h > CC scripts/mod/empty.o > Assembler messages: > Error: can't open arch/x86/kernel/macros.s for reading: No such file > or directory > make[2]: *** [scripts/Makefile.build:318: scripts/mod/empty.o] Error 1 > make[1]: *** [scripts/Makefile.build:558: scripts/mod] Error 2 > make: *** [Makefile:1050: scripts] Error 2 You are right. I tried to filter out the use of the switch (exported as ASM_MACRO_FLAGS) for empty.o. Any suggestions on how to do it properly? > Are you planning to support for all architectures, or x86-specific? Not right now. But I think that other architectures will also prefer to separate the inline assembly chunks in a similar manner, for better compilation, easier readability, and better code maintainability. Thanks again, Nadav