From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web11.11632.1590149658275377276 for ; Fri, 22 May 2020 05:14:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=SDZxLJWN; spf=pass (domain: nuviainc.com, ip: 209.85.221.65, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f65.google.com with SMTP id g12so8750771wrw.1 for ; Fri, 22 May 2020 05:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HtaAll61Vi2R3LKsbQvn4QDouVhVsIxhEM12iKQjqrg=; b=SDZxLJWNDPov75S9rrqp9K/e8UcTALX6Jenbx4aNIDfZbUxDFBsCQthDGqEWixiGz4 G9EJN+tvyJt2NhYvFCo6753hKy5IWqLkomzS5MMWP9XiEkHMgP0E/IDTcuw7Ot6zJUCB Lhx4VSH99P8BsAJV1AyI3Tgqr0D6CH8m9+FqLJHcXasOiVn4zUL87jjKpB05QxDHhumL vDFzl6rxGaaoQu8kt2qkYbcshJh7w8IUWaWByQ3ZUQTk6EOQnVDGGu0+bSppo4R3NDEz zuGURclfvUSgU4sxVhEUYNVxfJgpVTB5puAAoLrOFx78wjsWLpsJRDOqzqPSgCqUp5jh XUDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HtaAll61Vi2R3LKsbQvn4QDouVhVsIxhEM12iKQjqrg=; b=NwoOZlFlhfWJ/c4dmHYt6+ZFDORVm1vkR3P98lrPVUGkjZfET/sTkrVybub1HOLHVi tQXnf+kNfAYuh4yZk8hT3YavbvGtynIu3OPM6FO+1u2W8/8S7mZPe8brkLkAzZFP3GsR BdPgDmk7btM61CQJBZcZ5o2R85V29HKmCkWImtOjAej/t0ZGGBcmJiySB/dIHl0MWJod vMC83hiynFTL3f4QgaC2wOO658eQc4D7cx4IfHyNmn9JHCiUQMEhVDK12pKnbgO1srls 3PjVTezQcVQXE/MM+gLtigedlRZ1XG8xWUgNFyD75ss+Ftxk+xrKnfWGF3ZxYG+shT6V m1GA== X-Gm-Message-State: AOAM5338ZxOiULAxYR/m7oLsqyxi1sPl+eoDcgPCO6iBaHJp2hDNCV3I KKWHf+ba4AQSEq1lR8tLmoW2fA== X-Google-Smtp-Source: ABdhPJwBCd7Xs6IRfUBXyEwkz83+ZCUb7lAkySK0N7u2+BmvGK/FVH+UFCYzVebvKLLjR4oBwllyQA== X-Received: by 2002:adf:f512:: with SMTP id q18mr3475293wro.38.1590149656699; Fri, 22 May 2020 05:14:16 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id k13sm9067921wmj.40.2020.05.22.05.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 05:14:16 -0700 (PDT) Date: Fri, 22 May 2020 13:14:13 +0100 From: "Leif Lindholm" To: Ard Biesheuvel Cc: devel@edk2.groups.io, liming.gao@intel.com, lersek@redhat.com, philmd@redhat.com, mliska@suse.cz Subject: Re: [PATCH] MdePkg/Include: AARCH64: disable outline atomics on GCC 10.2+ Message-ID: <20200522121413.GC1923@vanye> References: <20200522101202.15016-1-ard.biesheuvel@arm.com> <20200522114101.GA1923@vanye> <628c2f09-207c-3146-df98-30ee2426899b@arm.com> MIME-Version: 1.0 In-Reply-To: <628c2f09-207c-3146-df98-30ee2426899b@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, May 22, 2020 at 14:05:02 +0200, Ard Biesheuvel wrote: > On 5/22/20 1:41 PM, Leif Lindholm wrote: > > On Fri, May 22, 2020 at 12:12:02 +0200, Ard Biesheuvel wrote: > > > 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=2723 > > > Signed-off-by: Ard Biesheuvel > > > > > > --- > > > 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. > > > > Hmm. I am just slightly concerned over referencing GCC 10.2 before GCC > > 10.2 is released. > > Presumably, there will be no ill effects if that pragma is enabled also > > on 10.2, we just won't need it? If so ... > > > > No the pragma is only enabled on 10.2 and later. Older GCCs will choke on > it. Urgh, right. I guess I'm having a "can't read" day. Still. That means that if the pragma gets pulled last second from 10.2, we now explicitly break builds for 10.2. No matter how low the risk of that happening, this doesn't make me comfortable. / Leif > > > MdePkg/Include/AArch64/ProcessorBind.h | 11 +++++++++++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/MdePkg/Include/AArch64/ProcessorBind.h b/MdePkg/Include/AArch64/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 > > > +#if defined(__GNUC__) && !defined(__clang__) > > > + > > > +// > > > +// Disable GCC outline atomics > > > +// Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2723 > > > +// > > > +#if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 2) > > > > Could we do >= 10 here for now, and update to this conditional once > > we've verified that the change does really make it into 10.2? > > > > That would break all GCC 10, even if no users of the outline atomics are > part of the build. > > > If so, I support including it in the stable tag. > > > > / > > Leif > > > > > +#pragma GCC target "no-outline-atomics" > > > +#endif > > > +#endif > > > + > > > #if defined(_MSC_EXTENSIONS) > > > // > > > -- > > > 2.17.1 > > > >