From patchwork Thu Apr 30 10:19:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11519753 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68C5A912 for ; Thu, 30 Apr 2020 10:21:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EFD620787 for ; Thu, 30 Apr 2020 10:21:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k2uRwX9O" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EFD620787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6Jb-0001i5-B8 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Apr 2020 06:21:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52418) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IV-0008Aw-BU for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IO-000172-4p for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:02 -0400 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:46271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IN-00011p-NN for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:19:55 -0400 Received: by mail-lf1-x144.google.com with SMTP id g10so734076lfj.13 for ; Thu, 30 Apr 2020 03:19:55 -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 :mime-version:content-transfer-encoding; bh=opmkyJ2lt40WK/inlwbmCnCG1rqTZ+e0R6h7t3/vrFE=; b=k2uRwX9OwkMyYc6oTmZaYb0KThhYS3YQi198O1K+0L1kVRxxAK0SUCfsYVvgzUldR/ Z6sn5JiYJTv5dNxnBp7H3uncJQEQPmDV30syaVPfQFOOyjkAOxZsKMgqvRqnIaqzW0V2 72fj8AdxB3xs+qQTxE6ad88e19Xwy9VPcUQoz3fPYsEljmpNBhn7vH2tSYIn2bKYZCFb RB0Smm5wC5tMCNPouKAL9VxoHilG/PIS5yikifC++luNBpZeWzWUMWvVHvKCYvyvZ7kP 2CLyc00ZXIJPPjwg4qJzeZXJ0TPAz6eC/6kADUZ/XtSV777mv7Y3ALGQWNZbEwvbeG9k NDSg== 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:mime-version:content-transfer-encoding; bh=opmkyJ2lt40WK/inlwbmCnCG1rqTZ+e0R6h7t3/vrFE=; b=hSt4TYho2NvPEnr1XD8AN+TDzZGMOP73HPY8pppDtFaj2mLI1KGrBh+pHMqOqcVC5s x/Mk0G5O6KFtCYQYaSLXurEvU1k1Lazf9tj2UPZl2KzakWDNrK0BgKLSjRpe8AhvchQu qDO2UWUSlnkNYtDCVRsQhCnFjWm0PoDOw20ZZm1qflEx9ZXEkMv6RTUzwwwS6y2/g2Kt mf65DG0mNQksq+urScFfByMsfK9qS+A7QDcqY78/iE+ovEJ0FunLLEo+ZbXRAZb8xtVg 1YE2dzTKbJM8DVYOdy1o0NEGIQVidLzg2l10FqeOQvDI+G2fdCqEJUpz+dlZqQbD+Rbl nWvg== X-Gm-Message-State: AGi0PuYvbBa6I1OFarJjlatdZyaGBQ5+ToVAArjTLRc0gNtytRYUkw5T 89subk8ngc1MOutk8q9kRizFRRJmJR0= X-Google-Smtp-Source: APiQypLlRmQsqA5Ug7rxz2I9zKbOWmyWkc2mt26kAzfzUFlbE85QbiwwXwm++vAS6tQndP0B0WjQsQ== X-Received: by 2002:a19:c3c5:: with SMTP id t188mr1720815lff.199.1588241993402; Thu, 30 Apr 2020 03:19:53 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id d18sm3868549lfm.36.2020.04.30.03.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:52 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 1/6] target/microblaze: Add the opcode-0x0-illegal CPU property Date: Thu, 30 Apr 2020 12:19:44 +0200 Message-Id: <20200430101949.7754-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::144; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x144.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::144 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the opcode-0x0-illegal CPU property to control if the core should trap opcode zero as illegal. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 6 +++++- target/microblaze/translate.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 1a700a880c..d51587b342 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -303,6 +303,7 @@ struct MicroBlazeCPU { bool endi; bool dopb_bus_exception; bool iopb_bus_exception; + bool opcode_0_illegal; char *version; uint8_t pvr; } cfg; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index c9cf2364ca..418a0cd1fa 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -206,7 +206,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.dopb_bus_exception ? PVR2_DOPB_BUS_EXC_MASK : 0) | (cpu->cfg.iopb_bus_exception ? - PVR2_IOPB_BUS_EXC_MASK : 0); + PVR2_IOPB_BUS_EXC_MASK : 0) | + (cpu->cfg.opcode_0_illegal ? + PVR2_OPCODE_0x0_ILL_MASK : 0); env->pvr.regs[5] |= cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -274,6 +276,8 @@ static Property mb_properties[] = { /* Enables bus exceptions on failed instruction fetches. */ DEFINE_PROP_BOOL("iopb-bus-exception", MicroBlazeCPU, cfg.iopb_bus_exception, false), + DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, + cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), DEFINE_PROP_END_OF_LIST(), diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 37a844db99..222632b670 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1573,7 +1573,7 @@ static inline void decode(DisasContext *dc, uint32_t ir) LOG_DIS("%8.8x\t", dc->ir); if (ir == 0) { - trap_illegal(dc, dc->cpu->env.pvr.regs[2] & PVR2_OPCODE_0x0_ILL_MASK); + trap_illegal(dc, dc->cpu->cfg.opcode_0_illegal); /* Don't decode nop/zero instructions any further. */ return; } From patchwork Thu Apr 30 10:19:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11519755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 650B115AB for ; Thu, 30 Apr 2020 10:21:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3786A20787 for ; Thu, 30 Apr 2020 10:21:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="huUnGmF+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3786A20787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6Jg-0001sT-7I for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Apr 2020 06:21:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52432) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IW-0008Bp-9r for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IP-00017I-4w for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:04 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:38623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IO-00016v-Lu for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:19:56 -0400 Received: by mail-lj1-x234.google.com with SMTP id e25so5884131ljg.5 for ; Thu, 30 Apr 2020 03:19:56 -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 :mime-version:content-transfer-encoding; bh=WFSocXCxBymnF1MvynrViesDS2ZIgpy+8V/Y8WL70Qw=; b=huUnGmF+7FvJsaC572x4H4NxH0s6xGpOl5Rjk3w/5yPFmi08/lCVgwmnvGGG5wM9Te eeKgjxwz3XCm+SK/qsJZ9/ABBKmYzJz2XghfUv3HCbyuByeQfL9WWk82TvZ8+22hkXTY O69r3ohmCP6tm+OAn6T5XAddJA6QF12g/qLGLydYWnUs+S4kToBN6hnwqzj0p81Zp7MH BhCpj44KX3MPV/ho/LTHCzG5tfFVwEmbI4Q/sr9w7yC2WaY12C5h+nmN7NimuC6qbomy mR7lszOMwec8fZidiz51KTxrUhzF4nQ9dqserzwnueMRuQG2ogNhOyft9Ev0Kly9n3rS cEuw== 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:mime-version:content-transfer-encoding; bh=WFSocXCxBymnF1MvynrViesDS2ZIgpy+8V/Y8WL70Qw=; b=Z7Q/H581X4oFpIJYWjf9HiiDH8vBqonLS0+Ft09zGS0y1dxZnfqyJYR/n5ixqX1oVm YaG9yXSZH/jwlE7dYDbqMNF+6+E9QEBcsi41weRlTGDtlbQpLa4KC5KgtT1BZ5RrV9rb emVuV8tO5YD/IpbeI+3A8XWtRgjYMKRdH03PkwwMd5SodXCwW3HX3jbDD4//msfQUSU7 B9ptksVtIoPCDOcrC3zRdpHrWdpNN9WTpTfvwpE1oWYpAzrNjXSYNxzw9tgaRa4JWyh7 DRdT2kew1vegOz0nhESfgoYRv7mYI5yjmpQ+JU0kSg9+qYij0aSVm3i/AjR/r2AnZ20D TDRQ== X-Gm-Message-State: AGi0PubQdXt6JZ4cLlM7wOTiwGwDMZnUsSnZcYCWSYIw342ngIrKO8tN ei5lIimy97LQmpJQaayeUBwvj+RWCNg= X-Google-Smtp-Source: APiQypLENNIAdSp/g0oKbeqwiYOVw5DL5Rjn1lJzTuDT+B6hTnfUQxkRjiDB7UUqcgTyqE4O17GBDQ== X-Received: by 2002:a2e:5847:: with SMTP id x7mr1718855ljd.61.1588241994777; Thu, 30 Apr 2020 03:19:54 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id a15sm3998823ljb.37.2020.04.30.03.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:54 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 2/6] target/microblaze: Add the ill-opcode-exception property Date: Thu, 30 Apr 2020 12:19:45 +0200 Message-Id: <20200430101949.7754-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x234.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::234 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the ill-opcode-exception property to control if illegal instructions will raise exceptions. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 4 ++++ target/microblaze/translate.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index d51587b342..71d7317a58 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -303,6 +303,7 @@ struct MicroBlazeCPU { bool endi; bool dopb_bus_exception; bool iopb_bus_exception; + bool illegal_opcode_exception; bool opcode_0_illegal; char *version; uint8_t pvr; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 418a0cd1fa..2cc6b1513c 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -207,6 +207,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) PVR2_DOPB_BUS_EXC_MASK : 0) | (cpu->cfg.iopb_bus_exception ? PVR2_IOPB_BUS_EXC_MASK : 0) | + (cpu->cfg.illegal_opcode_exception ? + PVR2_ILL_OPCODE_EXC_MASK : 0) | (cpu->cfg.opcode_0_illegal ? PVR2_OPCODE_0x0_ILL_MASK : 0); @@ -276,6 +278,8 @@ static Property mb_properties[] = { /* Enables bus exceptions on failed instruction fetches. */ DEFINE_PROP_BOOL("iopb-bus-exception", MicroBlazeCPU, cfg.iopb_bus_exception, false), + DEFINE_PROP_BOOL("ill-opcode-exception", MicroBlazeCPU, + cfg.illegal_opcode_exception, false), DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 222632b670..b4a78551ef 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -185,7 +185,7 @@ static void write_carryi(DisasContext *dc, bool carry) static bool trap_illegal(DisasContext *dc, bool cond) { if (cond && (dc->tb_flags & MSR_EE_FLAG) - && (dc->cpu->env.pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)) { + && dc->cpu->cfg.illegal_opcode_exception) { tcg_gen_movi_i64(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP_HW_EXCP); } From patchwork Thu Apr 30 10:19:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11519759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D843915AB for ; Thu, 30 Apr 2020 10:23:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE12420787 for ; Thu, 30 Apr 2020 10:23:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O6BaITq5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE12420787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6LQ-0005ER-OK for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Apr 2020 06:23:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52446) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IX-0008D6-MH for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IQ-00017f-2O for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:05 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:34352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IP-00017A-Ms for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:19:57 -0400 Received: by mail-lj1-x234.google.com with SMTP id f11so5905230ljp.1 for ; Thu, 30 Apr 2020 03:19:57 -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 :mime-version:content-transfer-encoding; bh=XHBGTarqSU7FvFVqR/1Ml1TW7QFmRL1nmZZFnmyDZqc=; b=O6BaITq5g3Ub6+OIszV26t5Ucn61I00nPkGnBrY/Y9872OtegiRqsCeYdaLuZ3CGok jeaDo+J4W6Upe+H+mk9P1g+is5gqVIW7Zm9nJqd0JQyBE2zMtffUy9x0b3T03j+xHTlT /wKQV39CwGS4Jg7RnhFwLA0xbfB+NhdR6olJRGOFiUbvCSPx7/CjXDfy46OHSuVy+Jw6 dOi4yAi4+nM2Nh24ckxNvp1zQVOn5xOOKjBMaY2uLvDJ6kkGsYfEdlxOtOw76Uer5Xnw rMiB8M+S8AKgL3/IJiMIpI2/OHU0hbkOOITkPjZIEvdgQrTN5JR89Jnr1hFgGGFl5gOq NY1w== 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:mime-version:content-transfer-encoding; bh=XHBGTarqSU7FvFVqR/1Ml1TW7QFmRL1nmZZFnmyDZqc=; b=e6/U9EViBxyBmn9Xdi28rSEqf5U2nxVOx/gtuz3Ej5ik3KfvWrRnmR3NOgqVbnLtTG QTcIPy3PPQyJTN7FtwSLyR9ImOoWMZ4FcVcmxCVuBUyX7pIECaKReTUhmCaaIA9QD2eY mK+XQoMQMk1mF/J0L6nANMCs8qdzQPVW37NNZSrkKxQlwyyJGpXdrXzblZg4FXzdNq2z 3SXMxC75abTIvfAEwNJ4i/247i+M+bWLJIqa7jr5xDVjJhQ3qkF30TMZ8vgv8L1NN3Y6 utvSZHTbpvLfGjq4k0nKAGixEiu8/+YqHncjEB/k0R7uWSBSNvOYmEgVyN1dJI0lv85s jDCw== X-Gm-Message-State: AGi0PubrHWmACPFPrniI4Bhmh5uwaU1DcU//cARpl/fkjxFWHRkYoL5m MVu8rI2m4ivQ0udyZz6fzHgFaH4InWs= X-Google-Smtp-Source: APiQypK+4Lhqzy8+5b22BRGc5MEYoYJvRcuIt2ToHeWYzkhBP0GsZlquPCkbdwUBWiIm5ld6LYB0Ng== X-Received: by 2002:a05:651c:50e:: with SMTP id o14mr1814519ljp.52.1588241995945; Thu, 30 Apr 2020 03:19:55 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id f10sm3009032lfl.82.2020.04.30.03.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:55 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 3/6] target/microblaze: Add the div-zero-exception property Date: Thu, 30 Apr 2020 12:19:46 +0200 Message-Id: <20200430101949.7754-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x234.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::234 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the div-zero-exception property to control if the core traps divizions by zero. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 4 ++++ target/microblaze/op_helper.c | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 71d7317a58..3c07f9b3f7 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -305,6 +305,7 @@ struct MicroBlazeCPU { bool iopb_bus_exception; bool illegal_opcode_exception; bool opcode_0_illegal; + bool div_zero_exception; char *version; uint8_t pvr; } cfg; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 2cc6b1513c..4211f50c11 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -207,6 +207,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) PVR2_DOPB_BUS_EXC_MASK : 0) | (cpu->cfg.iopb_bus_exception ? PVR2_IOPB_BUS_EXC_MASK : 0) | + (cpu->cfg.div_zero_exception ? + PVR2_DIV_ZERO_EXC_MASK : 0) | (cpu->cfg.illegal_opcode_exception ? PVR2_ILL_OPCODE_EXC_MASK : 0) | (cpu->cfg.opcode_0_illegal ? @@ -280,6 +282,8 @@ static Property mb_properties[] = { cfg.iopb_bus_exception, false), DEFINE_PROP_BOOL("ill-opcode-exception", MicroBlazeCPU, cfg.illegal_opcode_exception, false), + DEFINE_PROP_BOOL("div-zero-exception", MicroBlazeCPU, + cfg.div_zero_exception, false), DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index 18677ddfca..f3b17a95b3 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -132,11 +132,12 @@ uint32_t helper_carry(uint32_t a, uint32_t b, uint32_t cf) static inline int div_prepare(CPUMBState *env, uint32_t a, uint32_t b) { + MicroBlazeCPU *cpu = env_archcpu(env); + if (b == 0) { env->sregs[SR_MSR] |= MSR_DZ; - if ((env->sregs[SR_MSR] & MSR_EE) - && !(env->pvr.regs[2] & PVR2_DIV_ZERO_EXC_MASK)) { + if ((env->sregs[SR_MSR] & MSR_EE) && cpu->cfg.div_zero_exception) { env->sregs[SR_ESR] = ESR_EC_DIVZERO; helper_raise_exception(env, EXCP_HW_EXCP); } From patchwork Thu Apr 30 10:19:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11519761 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37F75912 for ; Thu, 30 Apr 2020 10:23:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D5BD20787 for ; Thu, 30 Apr 2020 10:23:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mosi9aoX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D5BD20787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6LY-0005WZ-5w for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Apr 2020 06:23:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52450) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IX-0008DL-Tz for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IR-00017t-If for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:05 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:41706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IR-00017d-5I for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:19:59 -0400 Received: by mail-lf1-x12b.google.com with SMTP id u10so744954lfo.8 for ; Thu, 30 Apr 2020 03:19:58 -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 :mime-version:content-transfer-encoding; bh=OIrWCjv3YCoAXpqwetGuNZL8wxZClcfAMwDABAcwnXE=; b=Mosi9aoXyMkPX51GSWdICQ1lgWyATJgquOiR9QCOFFdVCLZttAnkaxHhGLNxuk10fY eqvccS6DX1gOCJ3dNSZceIqIvA2D7bGL+Fa0A7fsNFA5/WcLsRZAhEozFVxf7BZl+pEU R8neYkfFHwHHZJ6N24zhsFKjskqLKbpU40sHtRZwp9xbqSria9JJ7te/eDk8PI1e6/SE fWnl5BGshDA5W2bCqeGvgZT96MQAuW7YQ/cx6hdVmIunjdPwRd3eV7OvJpq00KjKQBjw RHvJ1H+bMLtLlm5IksebAst5SZ9bqa50aMisieZ4cCPAEwWmWr5CMTyL/yXbGoAfF8aL RO0g== 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:mime-version:content-transfer-encoding; bh=OIrWCjv3YCoAXpqwetGuNZL8wxZClcfAMwDABAcwnXE=; b=Y3WWUekcwaHYL/SSGl8h96hgbge/ayCbHxlrmL7iUi/zbt3Iqf2B06KT7a8yMURTnH vF806puVxt2D3abAHETRytNJjKW7FduUtue7NeeRpfYuOn6SyyIVBxAh/9XQoTW1uIld py7ej2/21lZ91UV8Yxn6pqmQRSX29F1fKSPT5v0XF/YCqsh2OfQ4iv6Ko/lHFgjyLxI/ Fx+Hex1j4qOzQSX3R73rMevUR/QiAE2LztoULcxqmZYEMdx8DYyVyugre4Cks3JVqWId dlJ/tPGNB6o3lcDiV8x67q+j97uhp0MPKBR59/eRCw5i0DLqHTlrlzjexqG3ncQ9trt4 SQ7Q== X-Gm-Message-State: AGi0PuZOATaE7l1t7RXPSl69e2zgHRA/njHkofpLlZg5SwOWhZ0MWT4Q 8LBpY3YEHiE4PZCIwnr/Z7hVsEZPgSI= X-Google-Smtp-Source: APiQypKsgRxyPfcYyGS8fWoR0MkCLIIdYYFrNL6DnvoUehWu6+Ks6XfWdktOAVA7kEaQsMSY/cwZxQ== X-Received: by 2002:a19:d84:: with SMTP id 126mr1696739lfn.35.1588241997205; Thu, 30 Apr 2020 03:19:57 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id 24sm4205632ljv.3.2020.04.30.03.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:56 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 4/6] target/microblaze: Add the unaligned-exceptions property Date: Thu, 30 Apr 2020 12:19:47 +0200 Message-Id: <20200430101949.7754-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x12b.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::12b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the unaligned-exceptions property to control if the core traps unaligned memory accesses. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 4 ++++ target/microblaze/translate.c | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 3c07f9b3f7..ef9081db40 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -306,6 +306,7 @@ struct MicroBlazeCPU { bool illegal_opcode_exception; bool opcode_0_illegal; bool div_zero_exception; + bool unaligned_exceptions; char *version; uint8_t pvr; } cfg; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 4211f50c11..585e60e817 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -211,6 +211,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) PVR2_DIV_ZERO_EXC_MASK : 0) | (cpu->cfg.illegal_opcode_exception ? PVR2_ILL_OPCODE_EXC_MASK : 0) | + (cpu->cfg.unaligned_exceptions ? + PVR2_UNALIGNED_EXC_MASK : 0) | (cpu->cfg.opcode_0_illegal ? PVR2_OPCODE_0x0_ILL_MASK : 0); @@ -284,6 +286,8 @@ static Property mb_properties[] = { cfg.illegal_opcode_exception, false), DEFINE_PROP_BOOL("div-zero-exception", MicroBlazeCPU, cfg.div_zero_exception, false), + DEFINE_PROP_BOOL("unaligned-exceptions", MicroBlazeCPU, + cfg.unaligned_exceptions, false), DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index b4a78551ef..20b7427811 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -995,7 +995,7 @@ static void dec_load(DisasContext *dc) v = tcg_temp_new_i32(); tcg_gen_qemu_ld_i32(v, addr, mem_index, mop); - if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + if (dc->cpu->cfg.unaligned_exceptions && size > 1) { TCGv_i32 t0 = tcg_const_i32(0); TCGv_i32 treg = tcg_const_i32(dc->rd); TCGv_i32 tsize = tcg_const_i32(size - 1); @@ -1110,7 +1110,7 @@ static void dec_store(DisasContext *dc) tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop); /* Verify alignment if needed. */ - if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + if (dc->cpu->cfg.unaligned_exceptions && size > 1) { TCGv_i32 t1 = tcg_const_i32(1); TCGv_i32 treg = tcg_const_i32(dc->rd); TCGv_i32 tsize = tcg_const_i32(size - 1); From patchwork Thu Apr 30 10:19:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11519769 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E94E4912 for ; Thu, 30 Apr 2020 10:25:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C054120787 for ; Thu, 30 Apr 2020 10:25:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LgsUcN3P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C054120787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6Ng-0000kz-RY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Apr 2020 06:25:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52454) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IY-0008Dd-97 for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IT-00018b-2u for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:06 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:44836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IS-00017x-JZ for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:00 -0400 Received: by mail-lf1-x12c.google.com with SMTP id d25so738744lfi.11 for ; Thu, 30 Apr 2020 03:20:00 -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 :mime-version:content-transfer-encoding; bh=H+LlnR11EGsPQDlPMcEJH7+ri0Xqw8l/GkcrB28PjIQ=; b=LgsUcN3Pi1rFmJAQC4KL0ptX0ErKAdH11Bor9CRVFBxjvIFz+DYtmRxtRyiXF6RN/4 fCl7MoQtn/HfPEejf3P8RdaIN6T2xinhW5/yAkvtG0kcyexLJY2ShCE/W5SsTeQLwzHf mYaM5F+I3plF/j4Ejggb0IL48qR33ZXGzDBRYJdZ+wEUGq2nApa2Y4uT2PxaWBxw8M0h VkBJFzq2wzsMuCOYyQc+Rm15sTq0MsGJOPRHOwdnIF9TTvaXkhH1htP2ShcbQsW7a6wo 0fXC9I0Qy77+exJmqcXK8PvMWh7jR2j9LkYAp+LEVM4sVNRBDnbebuDbZ/SL6+WO1SiW H+WA== 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:mime-version:content-transfer-encoding; bh=H+LlnR11EGsPQDlPMcEJH7+ri0Xqw8l/GkcrB28PjIQ=; b=kgsdiRK/awGY9LDMGcnG+HWYrln3OjKwYEahtqFaGBi62zeg4SN8HscZXmw+BlnyxV TDhptRV6xv899gq0uvDuphteOrcjNH1NdzGPUA4lew9bp9JQ9nV/JbVwQVF48pzbIf7w FCjJiW2+SXiNPeH0s/j8tSdvdO7mSfWJtwIc42y0xCY8sZLoG5FhWthsZ12VCttQ+KIV 6m7Gv/pR2Cda3CRWn2/XDk6iXL6X98pEyqdJU616cNcMb8qZtg2NwRz3R2y6x/GbdNQc VrSE/cTi7nvwPbyWcLEAFjXpK+2CArCObNT6Yci7TcWKXHigr2cVE0WHfdGYjS7mTkQK EJpQ== X-Gm-Message-State: AGi0PuZUx4Sk2ZUiPlCOo87nhgnR9kvLX8ztM7J8sUm1zaUY8puYnbH/ amoHjw6mWw1spfNDSlp7+iBf/vCdJ/s= X-Google-Smtp-Source: APiQypJhksrB0uY3QYRfNoPf1R3vis4aUiKeL2odqkf8KGjlsuyp8mzo7wKpUpzXA5rDwXTYJ2Fq8w== X-Received: by 2002:a05:6512:1109:: with SMTP id l9mr1731682lfg.12.1588241998767; Thu, 30 Apr 2020 03:19:58 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id s8sm4534166lfd.61.2020.04.30.03.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:57 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 5/6] target/microblaze: Add the pvr-user1 property Date: Thu, 30 Apr 2020 12:19:48 +0200 Message-Id: <20200430101949.7754-6-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x12c.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::12c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the pvr-user1 property to control the user-defined PVR0 User1 field. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index ef9081db40..7bb5a3d6c6 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -307,6 +307,7 @@ struct MicroBlazeCPU { bool opcode_0_illegal; bool div_zero_exception; bool unaligned_exceptions; + uint8_t pvr_user1; char *version; uint8_t pvr; } cfg; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 585e60e817..df5ee21dd6 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -193,7 +193,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.use_mmu ? PVR0_USE_MMU_MASK : 0) | (cpu->cfg.endi ? PVR0_ENDI_MASK : 0) | (version_code << PVR0_VERSION_SHIFT) | - (cpu->cfg.pvr == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0); + (cpu->cfg.pvr == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0) | + cpu->cfg.pvr_user1; env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0) | @@ -292,6 +293,7 @@ static Property mb_properties[] = { cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), + DEFINE_PROP_UINT8("pvr-user1", MicroBlazeCPU, cfg.pvr_user1, 0), DEFINE_PROP_END_OF_LIST(), }; From patchwork Thu Apr 30 10:19:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11519779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C35215AB for ; Thu, 30 Apr 2020 10:28:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E8FE20787 for ; Thu, 30 Apr 2020 10:28:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bjbGefJg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E8FE20787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:44544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6QM-0004Av-0n for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 Apr 2020 06:28:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52460) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IZ-0008Ef-AZ for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IU-0001BQ-BC for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:07 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:46742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IT-00018M-S0 for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:01 -0400 Received: by mail-lf1-x131.google.com with SMTP id g10so734304lfj.13 for ; Thu, 30 Apr 2020 03:20:01 -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 :mime-version:content-transfer-encoding; bh=JgBptNqOPoZTQggyi+6DOXOV2a/1fkdOa8Q/I6vP82s=; b=bjbGefJgBdONjOv7DYHErPqlXJeqD4tOyygcruRGTSH8GLO3f7LgpYeF797qHGDwDs 6AMoL9Kz+3gbQ0arSRRpkl6wuLICZY1CqklEm0mnR5a50jHOQiSww1LnHueZk9BAE5I3 PLoycvXfkJiUfn/t57BeCb2gmzqKUmJM+iTpe2SLPsaZuV8tdVH/Fy29I9E+8FaMMNZa 8LkNvTEjV0WU0RzdwX138GkLwNnDn8YnpD7iDZ0g4jngmLkDu53ndTYJUByAltYZjY/E +o7gjF49zjn3uMHNx1Vqrol8tPwGcObfa3uH1xXPDZZy7Yb58FQvQrd2nmn3llRCXORD p5XQ== 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:mime-version:content-transfer-encoding; bh=JgBptNqOPoZTQggyi+6DOXOV2a/1fkdOa8Q/I6vP82s=; b=Cc3QgD8gJMFDpsT6R4jcWpXXW1zYuD7hyp57fzQ7IjWLUOptxTGP5TR/1GJrQQ32iP eVQa9N3A1fe4pRcKFtL0fLkgPNuUVQzQ58350Jg6xahLj4M7Ohn4owBKe6Pe46OSgOgj WOlseBv2eASfKgAQo3KRo5OSDNF5DnekZeZkuc7Fw0UFvAaJZ+d+TYCiCvcRLGE4JFTi aYrTrs6AqgF192TNOahEcxoc6YMItVn/skIisRFpnLBpDlwUCHOI3OT3nTrindj7uWw+ eapC2Nz+suAKru1brNGN7+Em9j2x9UfWV81pVxqSre/AxAk1AF4Gu9/FJcaLln3SrTi8 te2g== X-Gm-Message-State: AGi0Pua3xSeQKZFEnDloPKRpi+ntaScdECoMVdZLf4BjhkKPtWP8iZPN FUgymc50j0NZZ5QG/PiKSmuHVqK0fVI= X-Google-Smtp-Source: APiQypLY1vpWuQk8MZdfmSUuE7FxCiSX56T4rvCpoA+d1ogxiOCVB9gVtIe5X+Hp8inH/nZ5t//6kg== X-Received: by 2002:a19:6448:: with SMTP id b8mr1654720lfj.18.1588241999997; Thu, 30 Apr 2020 03:19:59 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id m22sm4039034lji.75.2020.04.30.03.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:59 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 6/6] target/microblaze: Add the pvr-user2 property Date: Thu, 30 Apr 2020 12:19:49 +0200 Message-Id: <20200430101949.7754-7-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x131.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::131 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the pvr-user2 property to control the user-defined PVR1 User2 register. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 7bb5a3d6c6..a31134b65c 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -308,6 +308,7 @@ struct MicroBlazeCPU { bool div_zero_exception; bool unaligned_exceptions; uint8_t pvr_user1; + uint32_t pvr_user2; char *version; uint8_t pvr; } cfg; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index df5ee21dd6..aa9983069a 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -196,6 +196,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.pvr == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0) | cpu->cfg.pvr_user1; + env->pvr.regs[1] = cpu->cfg.pvr_user2; env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0) | (cpu->cfg.use_hw_mul ? PVR2_USE_HW_MUL_MASK : 0) | @@ -294,6 +295,7 @@ static Property mb_properties[] = { DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), DEFINE_PROP_UINT8("pvr-user1", MicroBlazeCPU, cfg.pvr_user1, 0), + DEFINE_PROP_UINT32("pvr-user2", MicroBlazeCPU, cfg.pvr_user2, 0), DEFINE_PROP_END_OF_LIST(), };