From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.5924.1590067909049104549 for ; Thu, 21 May 2020 06:31:49 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7B5D8D6E; Thu, 21 May 2020 06:31:48 -0700 (PDT) Received: from [192.168.1.81] (unknown [10.37.8.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A7E113F305; Thu, 21 May 2020 06:31:46 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH v2] ArmPkg/CompilerIntrinsicsLib: provide atomics intrinsics To: Leif Lindholm Cc: devel@edk2.groups.io, glin@suse.com, lersek@redhat.com, liming.gao@intel.com References: <20200520114448.26104-1-ard.biesheuvel@arm.com> <20200521112353.GS1923@vanye> <20200521131644.GT1923@vanye> From: "Ard Biesheuvel" Message-ID: <059e1db5-8228-63a8-09ab-bb0efcd95176@arm.com> Date: Thu, 21 May 2020 15:31:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200521131644.GT1923@vanye> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/21/20 3:16 PM, Leif Lindholm wrote: > On Thu, May 21, 2020 at 14:58:56 +0200, Ard Biesheuvel wrote: >>> Reviewed-by: Leif Lindholm >>> Thanks! >>> >> >> Apparently, GCC 10 is getting fixed so that we can set a #pragma in >> MdePkg/Include/AArch64/ProcessorBind.h, and be done with it. >> >> That does mean you would need GCC 10.2 at least, or you get the error, >> unless we merge this patch as well. That would mean the intrinsics are never >> used in practice, but using a compiler that does use them will not break the >> build. >> >> I am leaning towards omitting this patch, but I could be convinced to adopt >> both mitigations. But the #pragma is strongly preferred. > > What is the codesize impact on a full RELEASE image? Not sure how that matters? Given the modular nature of EDK2, I would not expect the outline atomics to have any measurable size benefit. The intrinsics library is static, with each of the 100 different functions emitted into a separate section, so you only get what you use. > If non-negligable, how about #ifdefing the whole content out unless > some specific preprocessor flag is passed? Then at least there's a > quick workaround for anyone who needs it. > The linker will only incorporate the parts that are actually used.