Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: Juro Bystricky <juro.bystricky@intel.com>,
	<openembedded-core@lists.openembedded.org>,
	<jurobystricky@hotmail.com>
Subject: Re: [PATCH 1/1] glibc: Allow 64 bit atomics for x86
Date: Thu, 29 Oct 2015 16:00:59 -0500	[thread overview]
Message-ID: <5632890B.2010405@windriver.com> (raw)
In-Reply-To: <1446151418-16034-2-git-send-email-juro.bystricky@intel.com>

On 10/29/15 3:43 PM, Juro Bystricky wrote:
> This patch fixes [YOCTO#8140].
> 
> The fix consist of allowing 64bit atomic ops for x86.
> This should be safe for i586 and newer CPUs.
> It also makes the synchronization more efficient.

I'm not sure this is correct.. see below.

> Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> ---
>  .../glibc/glibc/use_64bit_atomics.patch            | 24 ++++++++++++++++++++++
>  meta/recipes-core/glibc/glibc_2.22.bb              |  1 +
>  2 files changed, 25 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc/use_64bit_atomics.patch
> 
> diff --git a/meta/recipes-core/glibc/glibc/use_64bit_atomics.patch b/meta/recipes-core/glibc/glibc/use_64bit_atomics.patch
> new file mode 100644
> index 0000000..eb7f2b2
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/use_64bit_atomics.patch
> @@ -0,0 +1,24 @@
> +This patch alows using 64 bit atomic instructions on a
> +32 bit platform. This is safe, providing x86 is Pentium or
> +later (would not work on i386, i486). Using 64 bit atomic 
> +instructions bypasses code containing a bug as documented in
> +https://bugzilla.yoctoproject.org/show_bug.cgi?id=8140
> +
> +Upstream-Status: TBD
> +
> +Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
> +
> +
> +Index: libc/sysdeps/i386/i486/bits/atomic.h
> +===================================================================
> +--- libc.orig/sysdeps/i386/i486/bits/atomic.h
> ++++ libc/sysdeps/i386/i486/bits/atomic.h
> +@@ -54,7 +54,7 @@ typedef uintmax_t uatomic_max_t;
> + # endif
> + #endif
> + 
> +-#define __HAVE_64B_ATOMICS 0
> ++#define __HAVE_64B_ATOMICS 1
> + #define USE_ATOMIC_COMPILER_BUILTINS 0

The patch will enable it for i486 and above, but you comment says i486 isn't
supported.

Normally you'd resolve this by creating a new

sysdeps/i386/i586/bits/atomic.h

(include or copy the original file)

and adjust the HAVE_64B_ATOMICS value at that point.

Then the sources will work for older systems and newer.

While 386/486 is likely not used much these days... I do also have a concern
about Quark CPUs.  Do you know if they support the 64B ATOMICS?  (I suspect they
do not.)  If that is the case, we might need to special case this patch and make
it 'i686' and above?

--Mark

> + 
> diff --git a/meta/recipes-core/glibc/glibc_2.22.bb b/meta/recipes-core/glibc/glibc_2.22.bb
> index 020e417..2494ad7 100644
> --- a/meta/recipes-core/glibc/glibc_2.22.bb
> +++ b/meta/recipes-core/glibc/glibc_2.22.bb
> @@ -50,6 +50,7 @@ SRC_URI_append_class-nativesdk = "\
>             file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
>             file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
>             file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
> +           file://use_64bit_atomics.patch \
>  "
>  
>  S = "${WORKDIR}/git"
> 



  reply	other threads:[~2015-10-29 21:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 20:43 [PATCH 0/1] Allow 64 bit atomics in glibc 2.22 for 32bit SDK Juro Bystricky
2015-10-29 20:43 ` [PATCH 1/1] glibc: Allow 64 bit atomics for x86 Juro Bystricky
2015-10-29 21:00   ` Mark Hatle [this message]
2015-10-29 21:31     ` Bystricky, Juro
2015-10-29 22:20   ` Richard Purdie
2015-10-29 22:29     ` Randy Witt
2015-10-30  7:13       ` Richard Purdie
2015-10-30 16:02         ` Bystricky, Juro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5632890B.2010405@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=juro.bystricky@intel.com \
    --cc=jurobystricky@hotmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox