From patchwork Thu Aug 16 02:54:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 144305 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1539690ljj; Wed, 15 Aug 2018 19:57:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxqvNHWr1ffV16u4FyepVnCDKWBVxs/Z+QtVgmIShBZEQK974GmAWQWd94rv5lD0USnrs9e X-Received: by 2002:aed:3c8c:: with SMTP id d12-v6mr28299743qtf.203.1534388262742; Wed, 15 Aug 2018 19:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534388262; cv=none; d=google.com; s=arc-20160816; b=yw6rknIbSD3U1zEywQYgIVJOaS6pEcBtXnL16yYa5Bo34gpjH4TGHAsKJ6oEF5NlsO Dxe/wsoTqLZ+bvPxlDiCmPWclD615pjLVdRKe7LHIN14JiDVQa3bCcSvYVfaoClptmZl d1peWn3X+SRpjTXu0l2Ri+NkybnNRjY/q6N4W87jRMEZtH9GwUXHWIBYH2+5pMK53OjS Dc1DtCu4Wq60qE72Obf57maoLE83uBx1PEHmp1xdHKnN/RhM41vcaPwvslHFXsT/tbnO 4d8S/JWzAGDQPENI5F6j83wrnnQSiaE6kwbwU/NZumNBfPYWnQzI/bG6vhUKDd4rAOvh bP5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=IhMON8SIkP+qjZyAFnHW2Wam9h9Vd5CT55tJoV/HJxY=; b=N5sHIugLtVElXaCaHbWhCrAxNZlFlo3YyOBgYlFXVwJF9hI+N4amayFbLaHD9q/jKs PnigHM8aThmnrXSy0+pNlOftSGMx+BkOBfNS15NyJAKiJCCchTCdFhAI6y0OVsRMJTTj G0ocBXY9bl4GUkELlbyfC94sFM4fejjmLQfi2AueDmY07xTv4Fe7CIItbNshAntJh1xt L/VvkLmEzRVW7dU0MUT9mx4rkFGzQsUKh3zxHWc6a+5dY576PPA4mBT0QyXLOuClCkdv b2Ls4+oJMv0mT76jC36oWHaoq/PRVbcfkHZf4maVnx4UJqeb4ik49FSq29xaC2zQXU6r AXLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xqp9x944; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e54-v6si6694737qvd.129.2018.08.15.19.57.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 15 Aug 2018 19:57:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xqp9x944; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fq8Tm-0003US-40 for patch@linaro.org; Wed, 15 Aug 2018 22:57:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fq8RB-0002IU-3z for qemu-devel@nongnu.org; Wed, 15 Aug 2018 22:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fq8R8-0006ix-Mk for qemu-devel@nongnu.org; Wed, 15 Aug 2018 22:55:01 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:35049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fq8R8-0006iK-GC for qemu-devel@nongnu.org; Wed, 15 Aug 2018 22:54:58 -0400 Received: by mail-pg1-x533.google.com with SMTP id w10-v6so1361295pgv.2 for ; Wed, 15 Aug 2018 19:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IhMON8SIkP+qjZyAFnHW2Wam9h9Vd5CT55tJoV/HJxY=; b=Xqp9x9446bC+sg/TqiY72VYhJEEhIz1YHsVa28iFz6jR9FlPXrtE3S+OcHCEqyJt5Z m2v7kEFmjrhonx6i6KwLdjZzRqt8uSI/oxFNTEubBZYGx39AfTQ8rpzb6IASKBhyJ2MI wY45xQ6iL0n8cTwTMqKdtqdcuUnoYZ3bACme4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IhMON8SIkP+qjZyAFnHW2Wam9h9Vd5CT55tJoV/HJxY=; b=OLLoLU83lvFwiDq1kdciZC8OgY+IZkqvpw91jXLQMaeiWzJ6lyxAMMBhmQkojjuBx8 2/vm8mQ3CRiFk6JiD5ED6GZPvlt9bqh10ximkP0bRzTjPfyOcoS2qLP0aFuMLs8j/+Ju q42eds/8l/Z21zcQUfBboZAjqt8Aic2YzDcJhpqdioDtEMRgZCE2qKMv+I75cWiHOJEf 8CbBI3A33H/yhwyqzecfCNZbcFqA5D63kFdHZKlkGpW1ougyZNhivoOo7qq64bnCMiZn Fs1rv5PVhL2oJQ/ohdNfRm6TtUEawc4925ZrzwvDjXC/QKASc6Akp1yGGXxTZR3V9PzA yXiA== X-Gm-Message-State: AOUpUlHd5/Ht24sEgCSa90PKTmpC5inAutkcd3pLAaL/+Ffk++5ODtWE NIQTJggACXvtk5bHo/iv4ym5OY9f9PI= X-Received: by 2002:a62:41d6:: with SMTP id g83-v6mr30104451pfd.219.1534388097231; Wed, 15 Aug 2018 19:54:57 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id k64-v6sm45231497pfc.160.2018.08.15.19.54.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Aug 2018 19:54:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 15 Aug 2018 19:54:49 -0700 Message-Id: <20180816025452.21358-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180816025452.21358-1-richard.henderson@linaro.org> References: <20180816025452.21358-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::533 Subject: [Qemu-devel] [PATCH 2/5] target/i386: Convert to HAVE_CMPXCHG128 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, cota@braap.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/i386/mem_helper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Emilio G. Cota diff --git a/target/i386/mem_helper.c b/target/i386/mem_helper.c index 30c26b9d9c..6cc53bcb40 100644 --- a/target/i386/mem_helper.c +++ b/target/i386/mem_helper.c @@ -23,6 +23,7 @@ #include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "qemu/int128.h" +#include "qemu/atomic128.h" #include "tcg.h" void helper_cmpxchg8b_unlocked(CPUX86State *env, target_ulong a0) @@ -137,10 +138,7 @@ void helper_cmpxchg16b(CPUX86State *env, target_ulong a0) if ((a0 & 0xf) != 0) { raise_exception_ra(env, EXCP0D_GPF, ra); - } else { -#ifndef CONFIG_ATOMIC128 - cpu_loop_exit_atomic(ENV_GET_CPU(env), ra); -#else + } else if (HAVE_CMPXCHG128) { int eflags = cpu_cc_compute_all(env, CC_OP); Int128 cmpv = int128_make128(env->regs[R_EAX], env->regs[R_EDX]); @@ -159,7 +157,8 @@ void helper_cmpxchg16b(CPUX86State *env, target_ulong a0) eflags &= ~CC_Z; } CC_SRC = eflags; -#endif + } else { + cpu_loop_exit_atomic(ENV_GET_CPU(env), ra); } } #endif