From patchwork Wed Sep 7 21:10:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 667179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sTxPX2B3Pz9s3s for ; Thu, 8 Sep 2016 07:27:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=leO1Ro2z; dkim-atps=neutral Received: from localhost ([::1]:43134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhkNB-0007o4-8N for incoming@patchwork.ozlabs.org; Wed, 07 Sep 2016 17:27:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhk8F-0000ZE-4D for qemu-devel@nongnu.org; Wed, 07 Sep 2016 17:11:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhk8E-0002nz-12 for qemu-devel@nongnu.org; Wed, 07 Sep 2016 17:11:43 -0400 Received: from mail-yw0-x242.google.com ([2607:f8b0:4002:c05::242]:33150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhk8D-0002nt-Td for qemu-devel@nongnu.org; Wed, 07 Sep 2016 17:11:41 -0400 Received: by mail-yw0-x242.google.com with SMTP id g192so1183318ywh.0 for ; Wed, 07 Sep 2016 14:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wVDUmaur2TzlGipxEDgOWhA7mo6lIucjkxn+gIJKmgE=; b=leO1Ro2zTMphrOKrgefYbP4RtnZtBWezNKaV0uY/cZxkjKnSEC+G9Af3s929EF1kob p8fylac2aqOlx0B8GxlBgesy/CsNkYu2g5IqzblA84J74fkaG3heQJdB5U/tbtlVWfCT oFhWf8HX31R07P0uLkaXcTYP9T7fM2UBBgfZ/JtkiWgcJU6nm+BWbzZFga08G1CriC2I UMGE/42uC+6Ntx4KHHpOWqdsi888S6aGt95EzvZ3ws26n4lPcR7rva3OE3uDVrV0BKqT tkVkL/uaCg1mPAYaToZDsKXpVKbIjxG7RSt79RB4h5k2QbBX2kd8aq1xiJJnIYn9Eo6X KMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=wVDUmaur2TzlGipxEDgOWhA7mo6lIucjkxn+gIJKmgE=; b=i3Utgh8fdCXEutbYbgOe1504u93FWVvnReXXZ7L2RpPT+tPuEr5ULKh4V9OotwuWlL 6K5tpPemjSBBLpeoj9QHGV7o/HFYYvv0tT/1QrBtNxE79qKiLIcnLBFr8Rom//JxV7Dy r2edJt98T3U8l09RaPHP3wjuzz9Uj54x7P6rc96SkqBo5z2i3yrQBVclU6V5N4lIj1uU mi0KciXnOady5UkghsGnhBOG3Xsx66sZI43kw3EJPIQH2f0x9MHpamU+hIWsu54UgjZJ 57ZtpwM1zSVF/ElBw0uYuqz/mU6YaU3pHMRr3iZlJ25CCvNYUUBFaZWTveKnp+X4Jt9/ HIkw== X-Gm-Message-State: AE9vXwOouuBOxRZAPCaDYMVyh197OUxSlLJm8aApB2WdPOd/qtwdqc1kef7uED04h9n/mQ== X-Received: by 10.129.107.131 with SMTP id g125mr24882502ywc.191.1473282701661; Wed, 07 Sep 2016 14:11:41 -0700 (PDT) Received: from bigtime.com (174-24-157-40.tukw.qwest.net. [174.24.157.40]) by smtp.gmail.com with ESMTPSA id 17sm15558301ywk.17.2016.09.07.14.11.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Sep 2016 14:11:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 7 Sep 2016 14:10:46 -0700 Message-Id: <1473282648-23487-17-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473282648-23487-1-git-send-email-rth@twiddle.net> References: <1473282648-23487-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::242 Subject: [Qemu-devel] [PULL 16/18] target-aarch64: Generate fences for aarch64 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: peter.maydell@linaro.org, Pranith Kumar Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pranith Kumar Signed-off-by: Pranith Kumar Message-Id: <20160714202026.9727-14-bobby.prani@gmail.com> Signed-off-by: Richard Henderson --- target-arm/translate-a64.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index f5e29d2..09877bc 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1305,7 +1305,7 @@ static void handle_sync(DisasContext *s, uint32_t insn, return; case 4: /* DSB */ case 5: /* DMB */ - /* We don't emulate caches so barriers are no-ops */ + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); return; case 6: /* ISB */ /* We need to break the TB after this insn to execute @@ -1934,7 +1934,13 @@ static void disas_ldst_excl(DisasContext *s, uint32_t insn) if (!is_store) { s->is_ldex = true; gen_load_exclusive(s, rt, rt2, tcg_addr, size, is_pair); + if (is_lasr) { + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_LDAQ); + } } else { + if (is_lasr) { + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_STRL); + } gen_store_exclusive(s, rs, rt, rt2, tcg_addr, size, is_pair); } } else { @@ -1943,11 +1949,17 @@ static void disas_ldst_excl(DisasContext *s, uint32_t insn) /* Generate ISS for non-exclusive accesses including LASR. */ if (is_store) { + if (is_lasr) { + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_STRL); + } do_gpr_st(s, tcg_rt, tcg_addr, size, true, rt, iss_sf, is_lasr); } else { do_gpr_ld(s, tcg_rt, tcg_addr, size, false, false, true, rt, iss_sf, is_lasr); + if (is_lasr) { + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_LDAQ); + } } } }