From nobody Thu Apr 25 17:41:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60108+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60108+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1590142329; cv=none; d=zohomail.com; s=zohoarc; b=GhXPGsmxfC1Xmz8dBVQe+c89+FxmKJSEC4StkPkwOoBCkFH7+nYnZV+EcJdJHBwjItnjMadkJ0pr42veZPjhtFAMHz7LW1FtgnMBKTLaM3aIIkwOUojzmOTzx3UZN/Yx/IiCgtGKO3HCCBNbT2oOAtF18ZmfTf2XXoUUjfsr9Js= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590142329; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=872LjKPWA9wFGy/biMO9eXdWL+0AAqg9oFk+5OfYHKs=; b=m4O6LcwW4occy6L2ZMdlujncb5N+ByF/EWxnwSl0ifYt+kjsPEfoAYqYSbI7uQAFfZayJKETig+G8/K3wVry+75VM6TlZcD3pnrX6XBF8KzGQBk8zBdKPOc5D7EVcVg9Bht5Jnn6fXvRPrpdYCKOKxpvXnjjj1zM1egptkHDEyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60108+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590142329472992.832575574696; Fri, 22 May 2020 03:12:09 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ppddYY1788612xv2YwLhL13R; Fri, 22 May 2020 03:12:09 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.10282.1590142328334136608 for ; Fri, 22 May 2020 03:12:08 -0700 X-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 F2615D6E; Fri, 22 May 2020 03:12:07 -0700 (PDT) X-Received: from e123331-lin.nice.arm.com (unknown [10.37.8.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 10AA33F305; Fri, 22 May 2020 03:12:05 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: liming.gao@intel.com, leif@nuviainc.com, lersek@redhat.com, philmd@redhat.com, mliska@suse.cz, Ard Biesheuvel Subject: [edk2-devel] [PATCH] MdePkg/Include: AARCH64: disable outline atomics on GCC 10.2+ Date: Fri, 22 May 2020 12:12:02 +0200 Message-Id: <20200522101202.15016-1-ard.biesheuvel@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@arm.com X-Gm-Message-State: yiElC0JSkaMzB3VRYwbhLgasx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590142329; bh=hsBLlExcFugxEgU5ntSQVePQchY3p8Ebk3eHsAD9k6M=; h=Cc:Date:From:Reply-To:Subject:To; b=B5CnC/wAS7+9g+OARDTQAD/IycPAElfYmXBc+iwxPD17BmtSh5MbW3qkMWmatp0CNPk LEAYs+6wg/0Oshq3e0RGNK0uPye0bWI4/bThq3P/lAQrNGJrS2K27P+4U7ze1byV1cuiY OfyaVZrUPxzM1FgoD1rPCHld0nDPCHiA75o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" GCC 10 enabled a feature by default that was introduced in GCC 9, which results in atomic operations to be emitted as function calls to intrinsics provided by a runtime library. Atomics are hardly used in EDK2, which runs on a single CPU anyway, and any benefit that would result from reusing library code that implements these operations is defeated by the fact that every EDK2 module will need to have its own copy anyway. So let's disable this feature on GCC versions that support the pragma to do so (GCC 10.2 and up) Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2723 Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- The GCC support for this pragma has already been pulled into the 10.2 release branch. I think we should consider adding this to the stable tag, so that the issue can easily be resolved by upgrading the compiler. Whether we add the intrinsics too is a separate matter, but we can revisit that later. MdePkg/Include/AArch64/ProcessorBind.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MdePkg/Include/AArch64/ProcessorBind.h b/MdePkg/Include/AArch6= 4/ProcessorBind.h index 896bf273ac7a..a3ca8f09e51c 100644 --- a/MdePkg/Include/AArch64/ProcessorBind.h +++ b/MdePkg/Include/AArch64/ProcessorBind.h @@ -24,6 +24,17 @@ #pragma pack() #endif =20 +#if defined(__GNUC__) && !defined(__clang__) + +// +// Disable GCC outline atomics +// Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2723 +// +#if __GNUC__ > 10 || (__GNUC__ =3D=3D 10 && __GNUC_MINOR__ >=3D 2) +#pragma GCC target "no-outline-atomics" +#endif +#endif + #if defined(_MSC_EXTENSIONS) =20 // --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60108): https://edk2.groups.io/g/devel/message/60108 Mute This Topic: https://groups.io/mt/74396053/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-