From nobody Fri Dec 19 18:59:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494399819187748.4625291971157; Wed, 10 May 2017 00:03:39 -0700 (PDT) Received: from localhost ([::1]:40719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8Ler-00041e-Tq for importer@patchew.org; Wed, 10 May 2017 03:03:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8Lcn-0002QN-OQ for qemu-devel@nongnu.org; Wed, 10 May 2017 03:01:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8Lcj-0007lp-JH for qemu-devel@nongnu.org; Wed, 10 May 2017 03:01:29 -0400 Received: from ozlabs.org ([103.22.144.67]:45165) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d8Lcj-0007lU-6k; Wed, 10 May 2017 03:01:25 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wN6bP69R2z9s7k; Wed, 10 May 2017 17:01:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1494399681; bh=R1oc5Qa5kkvgSsMi6F8oqcqqyGrMXtz0LhhO7QKngII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jnm91RFqmU5peskpTPWRgVx+/8fV4xE6MILWQhOKYoS6Dx1+n3BFyr8YS6JgpZC3W Jsbm0vhTtDUCc7i5LUaJLuOD5NE8p/ZxSff2YmHVoZLokC5WvBPtpRXVXfi//4aSIV 6chWro87PjmNPkTSUTzZA17z5+Mjy42LPDprmlHI= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 10 May 2017 17:00:57 +1000 Message-Id: <20170510070115.13063-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170510070115.13063-1-david@gibson.dropbear.id.au> References: <20170510070115.13063-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 04/22] target/ppc: Generate fence operations 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: mdroth@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com, aik@ozlabs.ru, mark.cave-ayland@ilande.co.uk, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, sjitindarsingh@gmail.com, bharata@linux.vnet.ibm.com, sam.bobroff@au1.ibm.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Nikunj A Dadhania Signed-off-by: Nikunj A Dadhania Reviewed-by: Richard Henderson Signed-off-by: David Gibson --- target/ppc/translate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 50b6d4d..4a1f24a 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -2971,6 +2971,7 @@ static void gen_stswx(DisasContext *ctx) /* eieio */ static void gen_eieio(DisasContext *ctx) { + tcg_gen_mb(TCG_MO_LD_ST | TCG_BAR_SC); } =20 #if !defined(CONFIG_USER_ONLY) @@ -3008,6 +3009,7 @@ static void gen_isync(DisasContext *ctx) if (!ctx->pr) { gen_check_tlb_flush(ctx, false); } + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); gen_stop_exception(ctx); } =20 @@ -3028,6 +3030,7 @@ static void gen_##name(DisasContext *ctx) = \ tcg_gen_qemu_ld_tl(gpr, t0, ctx->mem_idx, memop); \ tcg_gen_mov_tl(cpu_reserve, t0); \ tcg_gen_mov_tl(cpu_reserve_val, gpr); \ + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_LDAQ); \ tcg_temp_free(t0); \ } =20 @@ -3177,6 +3180,10 @@ static void gen_conditional_store(DisasContext *ctx,= TCGv EA, tcg_gen_br(l2); =20 gen_set_label(l1); + + /* Address mismatch implies failure. But we still need to provide the + memory barrier semantics of the instruction. */ + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_STRL); tcg_gen_trunc_tl_i32(cpu_crf[0], cpu_so); =20 gen_set_label(l2); @@ -3308,6 +3315,7 @@ static void gen_sync(DisasContext *ctx) if (((l =3D=3D 2) || !(ctx->insns_flags & PPC_64B)) && !ctx->pr) { gen_check_tlb_flush(ctx, true); } + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); } =20 /* wait */ --=20 2.9.3