From patchwork Tue Jun 20 15:51:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 9799871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E54DD60328 for ; Tue, 20 Jun 2017 15:52:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACF7B2849F for ; Tue, 20 Jun 2017 15:52:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1846284AF; Tue, 20 Jun 2017 15:52:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 175292849F for ; Tue, 20 Jun 2017 15:52:57 +0000 (UTC) Received: from localhost ([::1]:49422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNLSa-00059S-7X for patchwork-qemu-devel@patchwork.kernel.org; Tue, 20 Jun 2017 11:52:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNLRO-00057S-5O for qemu-devel@nongnu.org; Tue, 20 Jun 2017 11:51:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNLRL-00040W-5x for qemu-devel@nongnu.org; Tue, 20 Jun 2017 11:51:42 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:34295) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNLRK-00040I-U9 for qemu-devel@nongnu.org; Tue, 20 Jun 2017 11:51:39 -0400 Received: by mail-lf0-x243.google.com with SMTP id l200so3941626lfg.1 for ; Tue, 20 Jun 2017 08:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YmebYcF5xZOBUqSpaicL/NBQpgS0Z9k/FQENWoeTz9M=; b=ZU2fdf72giZiNJ809zKZWWWLURayuNxlzfV6MBoBG04AkEUB2ABnnMWL0+lx6OzYUt 4rcWI2ae0kYQTQq6noVl+oHuOYtaZc0sBc898CkuR0CuSCLfs3003ggbZrgAVvpuXVWO yT/CLEnsE5Bou9QMm1ZXpp9A19LdNfQStOkDHOAY/GnP32qXb6w+cOkiUaXg3Z9DJKKs VU6yKF/feYQyfXuT43sm+vOCyNQFu1dmu5i9VHX1Tmb6s8vR6wWW3WFhB/Qy27dcWDEM +/ggMUkzFfOnW2LFF38zNq+PyX/ye/MorAATOIE/r+6NlKfS6Is/Qzkhy4W04vYkB5ai MzHQ== 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=YmebYcF5xZOBUqSpaicL/NBQpgS0Z9k/FQENWoeTz9M=; b=sXj1PTO+uHWklhPXYDzy1ffUFvS/uUnuJtKbwwhwK63mhkaWnZ2fTbgV6GExKw16TU KprKJMkDC3532L051puDQ7FkgvReha0LYZv42mzt+7SJVxMkzNkLGc4Dt2oklS1z9rZL nETpEmSMnx2S8732JlZ/69EyxfSfcQVSdkNUxFHT1gZvst9P7r4LO66WwIRAlOIxWfvF fXRH7BksNRZZZp3s4z/kVlsSW24rmzG6o34T0JcqaDb92vpsLnSc6dfxVqqOBcHCeu0P 9wlbDkxSRaAtYyVRFp3RBYthz++AiXm7jYI1fFSjhTnp1fZvOsAGQdap9qTYo47o71Ft RbaQ== X-Gm-Message-State: AKS2vOyQ+wSXK2ehS/ikMoJ/PInJPAZx8fQO2afIbCAuTaIu2JG8IDLb bx7IvBqAG9YvWkMU X-Received: by 10.46.74.25 with SMTP id x25mr8953857lja.127.1497973897411; Tue, 20 Jun 2017 08:51:37 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id h83sm3189321lji.10.2017.06.20.08.51.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 08:51:36 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 20 Jun 2017 17:51:25 +0200 Message-Id: <1497973886-26257-8-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497973886-26257-1-git-send-email-edgar.iglesias@gmail.com> References: <1497973886-26257-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PATCH v1 7/8] target-microblaze: Introduce a use-msr-instr property 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: sai.pavan.boddu@xilinx.com, edgar.iglesias@xilinx.com, alistai@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Introduce a use-msr-instr property making msr instructions optional. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- target/microblaze/cpu.c | 5 +++-- target/microblaze/cpu.h | 1 + target/microblaze/translate.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 70e4743..bc96505 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -157,7 +157,6 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) | PVR2_D_LMB_MASK \ | PVR2_I_OPB_MASK \ | PVR2_I_LMB_MASK \ - | PVR2_USE_MSR_INSTR \ | PVR2_USE_PCMP_INSTR \ | PVR2_FPU_EXC_MASK \ | 0; @@ -188,7 +187,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.use_hw_mul ? PVR2_USE_HW_MUL_MASK : 0) | (cpu->cfg.use_hw_mul > 1 ? PVR2_USE_MUL64_MASK : 0) | (cpu->cfg.use_barrel ? PVR2_USE_BARREL_MASK : 0) | - (cpu->cfg.use_div ? PVR2_USE_DIV_MASK : 0); + (cpu->cfg.use_div ? PVR2_USE_DIV_MASK : 0) | + (cpu->cfg.use_msr_instr ? PVR2_USE_MSR_INSTR : 0); env->pvr.regs[5] |= cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -241,6 +241,7 @@ static Property mb_properties[] = { DEFINE_PROP_UINT8("use-hw-mul", MicroBlazeCPU, cfg.use_hw_mul, 2), DEFINE_PROP_BOOL("use-barrel", MicroBlazeCPU, cfg.use_barrel, true), DEFINE_PROP_BOOL("use-div", MicroBlazeCPU, cfg.use_div, true), + DEFINE_PROP_BOOL("use-msr-instr", MicroBlazeCPU, cfg.use_msr_instr, true), DEFINE_PROP_BOOL("use-mmu", MicroBlazeCPU, cfg.use_mmu, true), DEFINE_PROP_BOOL("dcache-writeback", MicroBlazeCPU, cfg.dcache_writeback, false), diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index e202229..5c960d0 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -301,6 +301,7 @@ struct MicroBlazeCPU { uint8_t use_hw_mul; bool use_barrel; bool use_div; + bool use_msr_instr; bool use_mmu; bool dcache_writeback; bool endi; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 36caa03..bb1bdfa 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -443,7 +443,7 @@ static void dec_msr(DisasContext *dc) LOG_DIS("msr%s r%d imm=%x\n", clr ? "clr" : "set", dc->rd, dc->imm); - if (!(dc->cpu->env.pvr.regs[2] & PVR2_USE_MSR_INSTR)) { + if (!dc->cpu->cfg.use_msr_instr) { /* nop??? */ return; }