[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/build: suppress EFI-related tool chain checks upon local $(MAKE) recursion


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 8 Oct 2021 14:34:46 +0200
  • 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
  • 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=OFn0lOiiW0WLh6vRi6H380V5FrGFAIi+h1wxCPTCcas=; b=VKkw/qDmSqmCmv7tiE3xmkQHN4Mm5GzToSNR5cU6M3REBFYNXO85gr9dReWNst/xhMcOrLbf64qual59w6ceH3bUNaDpe34GKvlGRZsFzgDYd9g89aQzmhR7s1XmIIhwB5UeRZsK3f25MUTL2b5wVShRAzxIyf5OnXJCHMeI7I90EwlKdS3PNE/f+8/DKVgmVAddEmKRgyMWovXtjggnLw4vAH33IHiJq1mseiqg+TLXy8kPKCdH7Ax1MxpepJQBGtwwSWQk7mgz8G4xKCxiiNEqo7czXCWvTzGYw4Ct/Gt+0toD63xcsWCV/ANvC1F5jx4u+QFBbRta/0d8J/fUTQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HTXuPNoy3ahBt25PNv6fNU90owJp4Bebb81mGGuXzFcJ5kWptgzJr0sigWhy/8l85DRt9i/CZXW/BmzFm6RWn3EjVsAAIYGtji6hAskQS7ALLl2R84VDcM0Q2Fb4EUp3BkkEeLCuYEcVFZZOAzomfyoSiL/zoV8LFJ3OhO+vYQEc2avQaF7hkILSXSU9ahGzUXOIu5f5fOKkNV6e93Z/zEPNFK1s08z0yjrsdIZRWE9ui02DhTmF8dr7/tt+MBpn5Rh6W0tYjEQcOkA69haRMTV2uBXj5p1GnVniD+UZoQryEzMqwu6hQ1f/CEeN7RDuEMtUsaRZZazDIiRJ8XRkfA==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 08 Oct 2021 12:35:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.10.2021 13:09, Anthony PERARD wrote:
> On Tue, Sep 21, 2021 at 05:43:38PM +0200, Jan Beulich wrote:
>> The xen-syms and xen.efi linking steps are serialized only when the
>> intermediate note.o file is necessary. Otherwise both may run in
>> parallel. This in turn means that the compiler / linker invocations to
>> create efi/check.o / efi/check.efi may also happen twice in parallel.
>> Obviously it's a bad idea to have multiple producers of the same output
>> race with one another - every once in a while one may e.g. observe
>>
>> objdump: efi/check.efi: file format not recognized
>>
>> We don't need this EFI related checking to occur when producing the
>> intermediate symbol and relocation table objects, and we have an easy
>> way of suppressing it: Simply pass in "efi-y=", overriding the
>> assignments done in the Makefile and thus forcing the tool chain checks
>> to be bypassed.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks.

>> ---
>> Obviously the real (but more involved) solution would be to do away with
>> the recursive $(MAKE) invocations, by breaking up the long linking
>> rules. Representing them instead through multiple smaller rules with
>> suitable dependencies is certainly possible (and might even reduce
>> redundancy).
> 
> There is an alternative to that. Linux have a script which does the kind
> of step we do. So maybe doing the same and move the recipe into a script
> would work too? This would allow to share the recipe between x86 and Arm
> as the link phase of xen-syms is nearly identical. But to avoid calling
> make from the script we would have to duplicate the recipe of %.o:%.S.
> The xen.efi rules is still x86 only and I don't know whether we could
> use the same script as for xen-syms.

Hmm, maybe. The main aspect I'm not sure about is that, as you say, we
have two linking targets while Linux has just one. If there are no
interdependencies regardless of build mode, doing what you suggest may
be fine. If there were interdependencies, your approach may lead to
serialization of both rules, while breaking up may allow large parts to
get carried out in parallel.

Also, not exactly fitting the pattern above, lines like

        $(MAKE) -f $(BASEDIR)/Rules.mk efi-y= $(@D)/.$(@F).0r.o 
$(@D)/.$(@F).0s.o

when split up allow both objects to (continue to) be built in parallel;
arranging for this from a script may be more involved (albeit my knowledge
of how make works is lacking here - maybe an instance invoked from a shell
script can use the parent make's job server just as well as one invoked
from a Makefile). As you may imply, I don't think we should be duplicating
the %.o:%.S rule, but indeed have make deal with this.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.