From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brRwr-00076Q-Bu for qemu-devel@nongnu.org; Tue, 04 Oct 2016 11:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brRwl-0004SU-MN for qemu-devel@nongnu.org; Tue, 04 Oct 2016 11:48:04 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brRwl-0004S6-D1 for qemu-devel@nongnu.org; Tue, 04 Oct 2016 11:47:59 -0400 Received: by mail-wm0-x22c.google.com with SMTP id k125so214426350wma.1 for ; Tue, 04 Oct 2016 08:47:59 -0700 (PDT) References: <1474048017-26696-1-git-send-email-rth@twiddle.net> <1474048017-26696-16-git-send-email-rth@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1474048017-26696-16-git-send-email-rth@twiddle.net> Date: Tue, 04 Oct 2016 16:47:57 +0100 Message-ID: <87mvikru8i.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 15/35] tcg: Add CONFIG_ATOMIC64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org Richard Henderson writes: > Allow qemu to build on 32-bit hosts without 64-bit atomic ops. > > Even if we only allow 32-bit hosts to multi-thread emulate 32-bit > guests, we still need some way to handle the 32-bit guest using a > 64-bit atomic operation. Do so by dropping back to single-step. > > Signed-off-by: Richard Henderson > --- > configure | 33 +++++++++++++++++++++++++++++++++ > cputlb.c | 4 ++++ > tcg-runtime.c | 7 +++++++ > tcg/tcg-op.c | 22 ++++++++++++++++++---- > tcg/tcg-runtime.h | 46 ++++++++++++++++++++++++++++++++++++++++------ > tcg/tcg.h | 15 ++++++++++++--- > 6 files changed, 114 insertions(+), 13 deletions(-) > > diff --git a/configure b/configure > index b4d3f90..1ab2e4a 100755 > --- a/configure > +++ b/configure > @@ -4479,6 +4479,35 @@ EOF > fi > fi > > +######################################### > +# See if 64-bit atomic operations are supported. > +# Note that without __atomic builtins, we can only > +# assume atomic loads/stores max at pointer size. > + > +cat > $TMPC << EOF > +#include > +int main(void) > +{ > + uint64_t x = 0, y = 0; > +#ifdef __ATOMIC_RELAXED > + y = __atomic_load_8(&x, 0); > + __atomic_store_8(&x, y, 0); > + __atomic_compare_exchange_8(&x, &y, x, 0, 0, 0); > + __atomic_exchange_8(&x, y, 0); > + __atomic_fetch_add_8(&x, y, 0); > +#else > + char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1]; This breaks with --enable-werror (and my Travis images): config-temp/qemu-conf.c: In function ‘main’: config-temp/qemu-conf.c:12:8: error: unused variable ‘is_host64’ [-Werror=unused-variable] I'm not sure what the best fix is here? Pass -no-werror to the test compile? -- Alex Bennée