From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLOIw-0006H1-UC for qemu-devel@nongnu.org; Fri, 08 Jul 2016 01:26:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLOIs-0006Nk-Kq for qemu-devel@nongnu.org; Fri, 08 Jul 2016 01:26:21 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:36099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLOIs-0006Nf-Gk for qemu-devel@nongnu.org; Fri, 08 Jul 2016 01:26:18 -0400 Received: by mail-qt0-x244.google.com with SMTP id w59so2446479qtd.3 for ; Thu, 07 Jul 2016 22:26:18 -0700 (PDT) Sender: Richard Henderson References: <1467392693-22715-1-git-send-email-rth@twiddle.net> <1467392693-22715-11-git-send-email-rth@twiddle.net> <20160708030028.GB28765@flamenco> From: Richard Henderson Message-ID: <1e98632c-2b0f-de72-4dc5-29297cfe94fb@twiddle.net> Date: Thu, 7 Jul 2016 22:26:14 -0700 MIME-Version: 1.0 In-Reply-To: <20160708030028.GB28765@flamenco> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 10/27] tcg: Add atomic128 helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: qemu-devel@nongnu.org, alex.bennee@linaro.org, pbonzini@redhat.com, peter.maydell@linaro.org, serge.fdrv@gmail.com On 07/07/2016 08:00 PM, Emilio G. Cota wrote: > On Fri, Jul 01, 2016 at 10:04:36 -0700, Richard Henderson wrote: >> Force the use of cmpxchg16b on x86_64. >> >> Wikipedia suggests that only very old AMD64 (circa 2004) did not have >> this instruction. Further, it's required by Windows 8 so no new cpus >> will ever omit it. >> >> If we truely care about these, then we could check this at startup time >> and then avoid executing paths that use it. >> >> Signed-off-by: Richard Henderson >> --- >> configure | 29 ++++++++++++- >> cputlb.c | 6 +++ >> include/qemu/int128.h | 6 +++ >> softmmu_template.h | 110 +++++++++++++++++++++++++++++++++++++------------- >> tcg/tcg.h | 22 ++++++++++ >> 5 files changed, 144 insertions(+), 29 deletions(-) >> >> diff --git a/configure b/configure >> index 59ea124..586abd6 100755 >> --- a/configure >> +++ b/configure >> @@ -1201,7 +1201,10 @@ case "$cpu" in >> cc_i386='$(CC) -m32' >> ;; >> x86_64) >> - CPU_CFLAGS="-m64" >> + # ??? Only extremely old AMD cpus do not have cmpxchg16b. >> + # If we truly care, we should simply detect this case at >> + # runtime and generate the fallback to serial emulation. >> + CPU_CFLAGS="-m64 -mcx16" ... > if compile_prog "" "" ; then > atomic128=yes > + elif compile_prog "-mcx16" "" ; then > + QEMU_CFLAGS="$QEMU_CFLAGS -mcx16" > + EXTRA_CFLAGS="$EXTRA_CFLAGS -mcx16" > + atomic128=yes Your change doesn't change anything. If the user gave -march=haswell, then cx16 is enabled and the first test succeeds. If the user gave -march=k8, the initial test would fail, but the second test would explicitly add cx16, and the second test would succeed. In all cases, cx16 gets enabled. r~