From patchwork Tue Jan 10 10:27:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 135251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E739CB6FCA for ; Wed, 11 Jan 2012 01:48:13 +1100 (EST) Received: from localhost ([::1]:55597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkcza-0005CA-MC for incoming@patchwork.ozlabs.org; Tue, 10 Jan 2012 09:48:02 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkYvd-0003TP-2Q for qemu-devel@nongnu.org; Tue, 10 Jan 2012 05:27:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkYvT-0004jI-V9 for qemu-devel@nongnu.org; Tue, 10 Jan 2012 05:27:41 -0500 Received: from ra.se.axis.com ([195.60.68.13]:57439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkYvT-0004iY-O2 for qemu-devel@nongnu.org; Tue, 10 Jan 2012 05:27:31 -0500 Received: from localhost (localhost [127.0.0.1]) by ra.se.axis.com (Postfix) with ESMTP id 9D59586C6F for ; Tue, 10 Jan 2012 11:27:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ra.se.axis.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "To" Received: from ra.se.axis.com ([127.0.0.1]) by localhost (ra.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HZPsX3071nhA for ; Tue, 10 Jan 2012 11:27:28 +0100 (CET) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by ra.se.axis.com (Postfix) with ESMTP id 93C1B4A096 for ; Tue, 10 Jan 2012 11:27:27 +0100 (CET) Received: from localhost (edgar.se.axis.com [10.93.151.1]) by thoth.se.axis.com (Postfix) with ESMTP id 83E1634103 for ; Tue, 10 Jan 2012 11:27:27 +0100 (CET) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 10 Jan 2012 11:27:26 +0100 Message-Id: <1326191247-14880-3-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1326191247-14880-1-git-send-email-edgar.iglesias@gmail.com> References: <1326191247-14880-1-git-send-email-edgar.iglesias@gmail.com> To: edgar.iglesias@gmail.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 195.60.68.13 X-Mailman-Approved-At: Tue, 10 Jan 2012 09:47:50 -0500 Subject: [Qemu-devel] [PATCH] microblaze: Break the tb at memory barriers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Edgar E. Iglesias --- target-microblaze/translate.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 180ac84..96ce2ec 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -1249,12 +1249,22 @@ static void dec_bcc(DisasContext *dc) static void dec_br(DisasContext *dc) { - unsigned int dslot, link, abs; + unsigned int dslot, link, abs, mbar; int mem_index = cpu_mmu_index(dc->env); dslot = dc->ir & (1 << 20); abs = dc->ir & (1 << 19); link = dc->ir & (1 << 18); + + /* Memory barrier. */ + mbar = (dc->ir >> 16) & 31; + if (mbar == 2 && dc->imm == 4) { + LOG_DIS("mbar %d\n", dc->rd); + /* Break the TB. */ + dc->cpustate_changed = 1; + return; + } + LOG_DIS("br%s%s%s%s imm=%x\n", abs ? "a" : "", link ? "l" : "", dc->type_b ? "i" : "", dslot ? "d" : "",