From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web11.11143.1590147665405911224 for ; Fri, 22 May 2020 04:41:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=whMla83W; spf=pass (domain: nuviainc.com, ip: 209.85.128.65, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f65.google.com with SMTP id f13so8349718wmc.5 for ; Fri, 22 May 2020 04:41:05 -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=3iqNP/dxMXCgovvClJE6TKuuNnsp3JEpkmt96A0g7Es=; b=whMla83WXBLdZFIYGmOUP/58Z0GVlGJx4gDS6A1WpIwYs/0huI038w93MzL1pJ2zzp gtqETCQTZnsaPw3Ayn+Ckt4529TQjchM9JGjz/vtfkENZkUfq5I7ZIGQngG5rQvmB76n M/oay+arYZicxBnrHXQHsS6BZ8U/1CliCTZn4PeLz2dKI/mkiKZN8whPIrFseWnE7yKV BbKIceQ3cEf6vkVX1oKlqdnBUy92zotVE4mC3CLtmHNWNV3p4urvK0zaaYQ+otKibfYd Ii2IFcg7tfKIs4I29tkaIPlnQYYZFmKwqy5P+oubU0Jj8nFpGIe1TOI/LA3Dl6oPf0AU oOVA== 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=3iqNP/dxMXCgovvClJE6TKuuNnsp3JEpkmt96A0g7Es=; b=NdWzDILZ1dTvqNAlC5idRSil7YjyvoDdj6PdlCS0bqzUwZg91bnLq7xq3DvnDxWs7T HRWfpxVpRItj0dayeb2oyAFaMNesc7lbwmejfchu5wgAFWHk9FRJO+6MkJ1D2JyhMO0P 4sfEIfnATZoaqKjv0e29l3rbO7te5FTuEh0HNb9Zw3GUyUKv/itxm1KoykYUYysMm/Ib aZJq75GaRwEoNRhU9x3efr+TKx1KekDRrPjFMgzc+3ME/wnwBnDWg/e9Fth4m5zLW3PK TKIJOUMkEsBu/pOq+PRTCkeqT45d2Wn+tHmI/ZaN4wPlAi8UksJf+l4pCvnAfowCtgT2 bErg== X-Gm-Message-State: AOAM532wsmi304vCpvGcWsFE0CyH/6qQMPArb/jBapdQHwLqrKiVatF8 hW2zjD144Ny3Wjhz/Lw40emGyw== X-Google-Smtp-Source: ABdhPJyW0rcl+VRr7sta4voy94GO7W9R6er8fNG1FUeZFLiCwTnrUDCq4lO4EEDwzcMEbY8KOt76cA== X-Received: by 2002:a05:600c:218e:: with SMTP id e14mr12493882wme.62.1590147663853; Fri, 22 May 2020 04:41:03 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id t7sm3317054wrq.41.2020.05.22.04.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 04:41:03 -0700 (PDT) Date: Fri, 22 May 2020 12:41:01 +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: <20200522114101.GA1923@vanye> References: <20200522101202.15016-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 In-Reply-To: <20200522101202.15016-1-ard.biesheuvel@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 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 ... > 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? 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 >