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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29D46C433EF for ; Mon, 11 Oct 2021 13:28:51 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C893260E8B for ; Mon, 11 Oct 2021 13:28:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C893260E8B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.206003.361450 (Exim 4.92) (envelope-from ) id 1mZvM3-0007wB-Dy; Mon, 11 Oct 2021 13:28:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 206003.361450; Mon, 11 Oct 2021 13:28:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mZvM3-0007w4-AI; Mon, 11 Oct 2021 13:28:35 +0000 Received: by outflank-mailman (input) for mailman id 206003; Mon, 11 Oct 2021 13:28:34 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mZvM2-0007vy-32 for xen-devel@lists.xenproject.org; Mon, 11 Oct 2021 13:28:34 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2062be32-2a97-11ec-80da-12813bfff9fa; Mon, 11 Oct 2021 13:28:32 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-20-mBfnUlkqO5m4JUtnHRJkCw-1; Mon, 11 Oct 2021 15:28:29 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB6862.eurprd04.prod.outlook.com (2603:10a6:803:130::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 13:28:28 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 13:28:28 +0000 Received: from [10.156.60.236] (37.24.206.209) by AM5PR0601CA0074.eurprd06.prod.outlook.com (2603:10a6:206::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 13:28:27 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2062be32-2a97-11ec-80da-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1633958911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W9kzb4yBJ9OGJMK0JLjIkh6eFopaFEA/AGpXNmsx6zw=; b=WMuceT4k9gLt0VdYxoytNadobM8u4o9nuX83gy3bIjrd6lD9rDryEeoMaPqMu+T/mosVp6 f00rPRCoiDDfeTJZsFKFh/dki8UOzmtTZaDdbSbrHr2RsH4SvRh+9fyeQiRiZgvN5wlDvt OKGBO+CwMhkgTdHqshfmx4fN81OgAow= X-MC-Unique: mBfnUlkqO5m4JUtnHRJkCw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G33pFvyomwleGXyV1O+MvVLvAZ1xvccCscBAlpB5e3eX5gYQD/z9cVaC5qlFviYzUSAfCs3SnCI5io+VhNPWbD/hYTJWx07MH3Ic4O7jLC80WAxa2Na9TkCJUAiLCpC8ukEJoD+b2m6E6vTtf48iYmj/YPjoMrVv5HTiqwsbS5r04C3aXbdeH+/7Et1x1U6bbv6weh3gACC0Kpfi5P48KzC8bFhBT3avp1ok5/DvJtPYK84TF45pDxH2F9toeotL56a92ot1bebe+b3ljpIR68uZJz6TpIt8JmN4R55TMUF+Wec+OmO5YcVj1FhUNDBRezPDj6WJ7MrhMmUaX0nsmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W9kzb4yBJ9OGJMK0JLjIkh6eFopaFEA/AGpXNmsx6zw=; b=VynkAk2uIjjHMp9BqD4hQkgxNSAvlxqOKkw9zOOoeoXSm5xB4vQJDpNY1L7VBfLsBKVRuEEK4xChZ/v3D78MKQGAkSnbIzpbYv4hZUrFX+PdNh7+YTlbZSFcpFe/d158HgpYvpOR1YvR2ioINCHsT0g3F4jbjKWJ67QCWaFYro3vNsQ5nanDmKB9ZzQYbDHOvo72aL8V8fXA1hTJ4K8qzzKi3jb1PL3hoyUFucvKnYXk5aJFIQPPRjnokzyLyJt8ZieBXOldPo0BO1uTTQV2kZ/p/2c6dZva7MdJaMIZ1VHEq7of4O7GKt5TXu2XHJ05NymeG+YB0Dw03YHa2PiDSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com; Subject: Re: [XEN PATCH v7 25/51] build: rework test/livepatch/Makefile To: Anthony PERARD Cc: Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , Ross Lagerwall , xen-devel@lists.xenproject.org References: <20210824105038.1257926-1-anthony.perard@citrix.com> <20210824105038.1257926-26-anthony.perard@citrix.com> From: Jan Beulich Message-ID: Date: Mon, 11 Oct 2021 15:28:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20210824105038.1257926-26-anthony.perard@citrix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM5PR0601CA0074.eurprd06.prod.outlook.com (2603:10a6:206::39) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dc5d8cc-0d0e-4d49-3798-08d98cbb02d9 X-MS-TrafficTypeDiagnostic: VI1PR04MB6862: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /geUbh7MtuDWexjovJc7OPdNBMrJzkGsN8Vur6YapEUh6MSIOihKRYqP/xR9Af33KYu7G5jkiTg2JGGh2T+TyP3crxHF8Z+f+rhwX+VB3oBQjjjaDbTsQLRnKGPN6PHdmT8HPoDsPZzfR6T43vlauHysZpdvDmmuvXSwKJN7NxbebP2tYm9u5V4LZjFrfh8c8d3mPDyaAI3P5xWaKF1KWiH0rZQhdSoSjbTjo0nL4Fqt+qmg9GBnff7+towAH5Rd3y912/DPxua9+yQltEFPO+PdIxxbgxEq2ds4nHHToetaUr0H1H7CFsfGI32cZZsh6TAPPOYIHtzE0A4iAgAIbJeoszfhY6zP+jga9UsFSNK2WvJuxAKzVsXqd+AE7hel2B/DnH1p8iHSVnniPNzPlAPHC6CBrqI+QUNBzzT2rnQEFf7OcSgnAkEoxVw8ZWjAKlV61icYA4yo+2foECFYS5TcP6CAnR/jYuPWYJ2+XwAa2gfAjKRl3Ji2HqbjqDdWlh8jKlVAhhCaIx2KgVjCnpYelc/Uu6S9sBGhFpLQnJ/DEc0/7AZajPOvIemDUlT5sLjRtprz/fyYJnHqu25dKDwFe+YsVMNQkXzM8XL4lSabHKF+tDTaKc9zLKBOR5BOvOkfURNbCv4ts8FEG/icfuR/wSK6anc0d/4zciEyldJj+v+Zi/vQoUFiSziMSzW9bzjESKGFhb2ZylnBro3NUTXwDUL+WMDVYW4CYofEy1XNaJXpapnU8FyFnxcY4rgn X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(38100700002)(5660300002)(7416002)(54906003)(26005)(186003)(31686004)(53546011)(6486002)(4326008)(86362001)(8676002)(316002)(508600001)(16576012)(83380400001)(2616005)(31696002)(8936002)(956004)(66946007)(6916009)(66476007)(66556008)(2906002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dTR6RHBZbkQ2Qld4ZTlOeE1vQmZTU04yc3RtTWNEbFlQaS8vaGUyZWl1Mmcz?= =?utf-8?B?bXpGRTg3YWpJbytj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MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 13:28:28.5478 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lOWvp22s+PIIKznr7LOBYQSx0/X+Za/AeV3Opcx3wSE7Y0hynRQ+2S+w4Ksn3ns6tmks6Zm397uKVf5oUjvgDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6862 On 24.08.2021 12:50, Anthony PERARD wrote: > This rework the livepatch/Makefile to make it less repetitive and make > use of the facilities. All the targets to be built are now listed in > $(extra-y) which will allow Rules.mk to build them without the need of > a local target in a future patch. > > There are some changes/fixes in this patch: > - when "xen-syms" is used for a target, it is added to the dependency > list of the target, which allow to rebuild the target when xen-syms > changes. But if "xen-syms" is missing, make simply fails. > - modinfo.o wasn't removing it's $@.bin file like the other targets, > this is now done. > - The command to build *.livepatch targets as been fixed to use > $(XEN_LDFLAGS) rather than just $(LDFLAGS) which is a fallout from > 2740d96efdd3 ("xen/build: have the root Makefile generates the > CFLAGS") > > make will findout the dependencies of the *.livepatch files and thus > what to built by "looking" at the objects listed in the *-objs > variables. The actual dependencies is generated by the new > "multi_depend" macro. > > "$(targets)" needs to be updated with the objects listed in the > different *-objs variables to allow make to load the .*.cmd dependency > files. > > This patch copies the macro "multi_depend" from Linux 5.12. > > Signed-off-by: Anthony PERARD Just two and a half remarks; I'd really like the livepatch maintainers to properly review this change. > --- a/xen/scripts/Kbuild.include > +++ b/xen/scripts/Kbuild.include > @@ -151,3 +151,12 @@ why = \ > > echo-why = $(call escsq, $(strip $(why))) Not the least seeing this in context, ... > endif > + > +# Useful for describing the dependency of composite objects > +# Usage: > +# $(call multi_depend, multi_used_targets, suffix_to_remove, suffix_to_add) > +define multi_depend ... I would wish we wouldn't introduce further names with underscores in them when dashes are valid to be used. > +$(foreach m, $(notdir $1), \ > + $(eval $(obj)/$m: \ > + $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) I'd like to suggest to be consistent here: Either $(s) and then also $(m) in both places, or $m and then also $s. > --- a/xen/test/livepatch/Makefile > +++ b/xen/test/livepatch/Makefile >[...] > +$(obj)/%.livepatch: FORCE > + $(call if_changed,livepatch) > + > +$(call multi_depend, $(filter %.livepatch,$(extra-y)), .livepatch, -objs) > +targets += $(sort $(foreach m,$(basename $(notdir $(filter %.livepatch,$(extra-y)))), \ > + $($(m)-objs))) I think it would help readability if the 2nd line was properly indented to reflect the pending open parentheses: targets += $(sort $(foreach m,$(basename $(notdir $(filter %.livepatch,$(extra-y)))), \ $($(m)-objs))) or (less desirable imo) targets += $(sort \ $(foreach m,$(basename $(notdir $(filter %.livepatch,$(extra-y)))), \ $($(m)-objs))) Jan