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.5162.1590065941680848418 for ; Thu, 21 May 2020 05:59:02 -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 382A5D6E; Thu, 21 May 2020 05:59:00 -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 682413F305; Thu, 21 May 2020 05:58:58 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH v2] ArmPkg/CompilerIntrinsicsLib: provide atomics intrinsics To: devel@edk2.groups.io, leif@nuviainc.com Cc: glin@suse.com, lersek@redhat.com, liming.gao@intel.com References: <20200520114448.26104-1-ard.biesheuvel@arm.com> <20200521112353.GS1923@vanye> From: "Ard Biesheuvel" Message-ID: Date: Thu, 21 May 2020 14:58:56 +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: <20200521112353.GS1923@vanye> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/21/20 1:23 PM, Leif Lindholm via groups.io wrote: > On Wed, May 20, 2020 at 13:44:48 +0200, Ard Biesheuvel wrote: >> Gary reports the GCC 10 will emit calls to atomics intrinsics routines >> unless -mno-outline-atomics is specified. This means GCC-10 introduces >> new intrinsics, and even though it would be possible to work around this >> by specifying the command line option, this would require a new GCC10 >> toolchain profile to be created, which we prefer to avoid. >> >> So instead, add the new intrinsics to our library so they are provided >> when necessary. >> >> Signed-off-by: Ard Biesheuvel > > I feel unsure about whether this change is still proposed to go in, > but if it is, please fold in a BZ reference > (https://bugzilla.tianocore.org/show_bug.cgi?id=2723) in commit > message. With that: > > 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.