From nobody Sun Feb 8 21:23:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587150811; cv=none; d=zohomail.com; s=zohoarc; b=IRZa8iJgSSnFwGOg1utC9aUmEWGddULftqfXRiRDiZgnyWxKsQdJCq1EzvXIY0Z2/cCkmnrMfNgKU8Z22QaJixTbSZB8iSBa5s3e067CerwRou9y35gdpM7P6Fms8BoAl4uY8TSS8q4GxXUitVsAwMI9otS76XyUpDqGvKIhcVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587150811; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j4+pLj7eQpP+1IFfO1O1TwFE+yPC5V1FdSQ5yPNNIxA=; b=LGKjc5fw30k58ufyWFfxeswMFPHLCqE0AdxebERXXuUZh0JswyYWOxlu4qaDgmcJq1qo6LfMa7fEeGboT2seVewjYqpmiWCukdUs1hHZx1H1E/uWD6JHmONtH0OVfkbecDkXMUK+0YlH491lv3kaQ9DNqUjYHC5vfzcUiqgmAN0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587150811489983.2594691475441; Fri, 17 Apr 2020 12:13:31 -0700 (PDT) Received: from localhost ([::1]:50974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWQc-0005RH-5t for importer@patchew.org; Fri, 17 Apr 2020 15:13:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54219) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWNh-0002fJ-6L for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPWNf-0005H6-3a for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:29 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:33073) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPWNe-0005Ep-Rz for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:27 -0400 Received: by mail-lj1-x242.google.com with SMTP id q22so3200501ljg.0 for ; Fri, 17 Apr 2020 12:10:26 -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 j22sm19235399lfg.96.2020.04.17.12.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:10:24 -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=j4+pLj7eQpP+1IFfO1O1TwFE+yPC5V1FdSQ5yPNNIxA=; b=SI5oIYz0rxAo0t32NBu+qd3LM6xE/sY4dTJJZBK2aCB01JY8UPCfxYQVWpesPHRxZ9 GW8/z9uAzFtO0UjzwH+J3R8h2s3hoa1SJiAI4FlIQJuweRr7phWBdpI5+V1AidRpK4qw IdnR8NkhEkf2hCVDvFPkw5rIUz656xJPiWuH7q9nzTtlTuMgMk+LyK0dCzryI2TEylVd rz41QCfCFzwI2n08ZFva9nPn21oGHx8ZhJAvtTZKfYU8Oh7RFpVmUmfnB/Tl5IqAZVca BNIn/qI/1xCv30Mel9myKTzHwe6L0YqVoQVvh5QvX250d3bN2uN6oLeccpMT3SeixDsN CDbg== 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=j4+pLj7eQpP+1IFfO1O1TwFE+yPC5V1FdSQ5yPNNIxA=; b=bY/PXhqg9viWZWE+5E8Uv2BON5yhvnEb+vGdSlnkOx1h+jzavxY+dExbKRuIDRg6O+ 3qzhZW0pQiE11iicbQ8HiJWsb7OEmYR1Sl15IGZVYEl/k4Ewd7FYXd98NWKKv4xr4Duk u04qSTce36MxHTM/C1rEDI9z8VGUuH4y5YCCLNUGe3HOzm6HYS96fqA/B7Hn0LsVeii/ Q/tianxsgni0QEy5QP1+dsATv9MqzWf+x1GebKQXNttUKglGm3xI81vqoeLO9u82jjri vXk1gheqef3pyF78x7S6/u1lsPD8DYQ6JEhzlbM+PiwRNOu0eSxVhIbh0Jy7+hO06WfK +R7w== X-Gm-Message-State: AGi0PubcoghPuy8YSdx8sxkHZMqj6KpfukschNlID2SSF97NpN+G74Ko VwlRTKj4eMAK1yh833mjyezn04LsAq8fzw== X-Google-Smtp-Source: APiQypLNkc8db9WZydwpU+px78fjKec64UnfXLIp2fZanWQKzTNifgWfjNMZ66QSLvpKPxGob4353Q== X-Received: by 2002:a2e:988f:: with SMTP id b15mr3116550ljj.232.1587150625127; Fri, 17 Apr 2020 12:10:25 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 1/6] target/microblaze: Add the opcode-0x0-illegal CPU property Date: Fri, 17 Apr 2020 21:10:17 +0200 Message-Id: <20200417191022.5247-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417191022.5247-1-edgar.iglesias@gmail.com> References: <20200417191022.5247-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::242 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the opcode-0x0-illegal CPU property to control if the core should trap opcode zero as illegal. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/cpu.c | 6 +++++- target/microblaze/cpu.h | 1 + target/microblaze/translate.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index a2c2f271df..1044120702 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); =20 env->pvr.regs[5] |=3D cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -274,6 +276,8 @@ static Property mb_properties[] =3D { /* 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/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/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); =20 if (ir =3D=3D 0) { - trap_illegal(dc, dc->cpu->env.pvr.regs[2] & PVR2_OPCODE_0x0_ILL_MA= SK); + trap_illegal(dc, dc->cpu->cfg.opcode_0_illegal); /* Don't decode nop/zero instructions any further. */ return; } --=20 2.20.1 From nobody Sun Feb 8 21:23:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587150913; cv=none; d=zohomail.com; s=zohoarc; b=kGY0P2jXtIu3mJoqicrt1QmpndFyLS1XDEA3AC9aZA1TIwnGQSKsy9TqjNWpKIaj32QzpTniDQH5HYLPY0er1AinEJyQmRjPKo9fciUThNi3XjA2HwLP36wN++2rxw0CBaf7VJ4+b8aWzxxuy/TDrQz8aRLR46ck8PgA6ZU9tXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587150913; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2x2mJH31KlGYiU2wu4PSoZqahVuM0TdaRfwUNuf81eo=; b=J47wCUkgVHJYSFLddgwXo//FmdnG2Q2Hyg1i+1nOx8EYJQxgHcxhoL2v4Kq92NvhJFrTwk32svApAIHoRCfbwh+2qq+XLxwo2FQiOOOnvNPH0sO74ACe3p4GI5+DgtoMH2DZCUGwMaUWBXqf1sZ+8LMKO+qoN2AyDNf/aeetmoY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587150913298913.6108067961194; Fri, 17 Apr 2020 12:15:13 -0700 (PDT) Received: from localhost ([::1]:50986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWSG-0007q2-2d for importer@patchew.org; Fri, 17 Apr 2020 15:15:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54242) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWNh-0002fT-J1 for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPWNg-0005IW-6D for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:29 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:34289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPWNf-0005HB-TW for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:28 -0400 Received: by mail-lj1-x242.google.com with SMTP id m8so3189522lji.1 for ; Fri, 17 Apr 2020 12:10:27 -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 t24sm21828574lfk.90.2020.04.17.12.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:10:25 -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=2x2mJH31KlGYiU2wu4PSoZqahVuM0TdaRfwUNuf81eo=; b=ElPON/mIvPA2n2q3lUm+ykax6vitPr2lkTceEDS1GVOds0dgZ7ahsN9ZeXLQ+zOwZs bYmRVk0oVT9mXCDAPwNedNCXuRd8MshYnka5hSoxC1bgphkPcrzigJtiUti1bwKOJc4s mPQK12bwS3R+hpbCu56pZJ25xKP5Gwl0a5ka75dLOaXe5UOQo98hKHic/vHooObhPkNK fs01ZVBQGjKvqUNE8zPDZWahikaHuII1B7hMIUwnziM2FPvQrsAk3BwYcqCtrOXsEHyt Yaou5+4m/IQhIyQzUQ+tt91yXwDXTCB+zfNXeOnNk+7K1u9LZ/rXlR+MJP/0nALTVVSe Oorg== 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=2x2mJH31KlGYiU2wu4PSoZqahVuM0TdaRfwUNuf81eo=; b=huY85e5fWOIhmziDBIsUKBqOmIdgL3EKtizKcIHT1eqtgWwLM/GfFhwVJKsfDoI8fY C57l/Db+1jnGvsbSTQNlPfTMC4nanLVs6BeHcu9eV5f8pbLYlqPJ/DC3h39JWgmGFtjZ w4mWPgHwGABTAGE5i5WWIZJ1kUTUc8UV1UHZ7t4eX3mlREQhm+yfUwQ8RjapICaf79ef hCO4QX60BnljSfMb6VRWc0BbT6jt3tBXe0YL5s/urjuK3VbPmsOMF+LKaoa60mEiuQNf 3HRpEtXr4ml1E/Op6t+U2SVie8VJjvAt3oI0VhsG1pGhQHq0g0C0EcizuZcghcnGkkRD +LyQ== X-Gm-Message-State: AGi0PubXh6QncIKNE3xU7ZsvlXI+vbdECeyfonaf4Txkm0O5VYzFfcmR 2N0ZGHRWoWVEbMQbdsnQH5d5dC1Xju9Vzw== X-Google-Smtp-Source: APiQypLedWpga3PNMupgadifDgKxRR/25Ve3e9f7aa+VLkeaB5jNvS5RDWmLa70ANHDEryoKBNoTwQ== X-Received: by 2002:a2e:8290:: with SMTP id y16mr3083016ljg.186.1587150626413; Fri, 17 Apr 2020 12:10:26 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 2/6] target/microblaze: Add the ill-opcode-exception property Date: Fri, 17 Apr 2020 21:10:18 +0200 Message-Id: <20200417191022.5247-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417191022.5247-1-edgar.iglesias@gmail.com> References: <20200417191022.5247-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::242 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the ill-opcode-exception property to control if illegal instructions will raise exceptions. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/cpu.c | 4 ++++ target/microblaze/cpu.h | 1 + target/microblaze/translate.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 1044120702..36c20d9724 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); =20 @@ -276,6 +278,8 @@ static Property mb_properties[] =3D { /* 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/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/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); } --=20 2.20.1 From nobody Sun Feb 8 21:23:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587151017; cv=none; d=zohomail.com; s=zohoarc; b=Z8SI3OC5xdEOneVDf/fJQxdHIv2yywjaLZm4XA/beXUnlMTxfAGxrVNz6DvUecP+R2VUCL6bH8Gi9NOXWK06I5v7mFr4ENkAFw8/96qV0bEvYmXc0ft3Ek/L4SU2ke6P+HXRLKky6UfQ/DucPC7/h5bfdNJiZRiY5LjavZE1PNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587151017; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eFVwLS4HPN4oqr0mH+SQHWdJFcIbsw3m7YyR83VCRKI=; b=KuC3e6pvHALu1X4NM3j2q4XNYEkxXno5We5tNOJwI0cTZKHJTNqH/PZUvVLLjYRHbnURVA5pqpMmNbH+3h/2V4q/YfxAijZ9+C6CRZDIuym77S142E+jhaptb29z/9UkZZnfpur+pWyB53YZnJtgmR9caeEBOok1MRgEwzZDxr0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587151017182875.7647012621868; Fri, 17 Apr 2020 12:16:57 -0700 (PDT) Received: from localhost ([::1]:51016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWTv-0000wy-RV for importer@patchew.org; Fri, 17 Apr 2020 15:16:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54302) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWNi-0002go-OK for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPWNh-0005LX-Jk for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:30 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:33074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPWNh-0005JA-Bj for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:29 -0400 Received: by mail-lj1-x243.google.com with SMTP id q22so3200624ljg.0 for ; Fri, 17 Apr 2020 12:10:29 -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 q19sm1656943ljj.84.2020.04.17.12.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:10:27 -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=eFVwLS4HPN4oqr0mH+SQHWdJFcIbsw3m7YyR83VCRKI=; b=gztDRzsG1tIftHUgWi8hworbKaq+Iy/B54cbxUDsHevQabD7CIcYxx08o6qZqvd86o mhsA0URcjhKJZG3xmf5mYoqXZ58wl+/h/If6I0UCxzYV9KTq/XQZkZH82JVjhz+m8LPy k+3AbPlq5mBeaeiPuvxTAXzrlbRMZlMOi20x+u1cJOaB6mVQ/HW3+prHU5vAjcVyqYrO tYcAJrq7RIi197leQPCmWBTdM2M0+obMHHpHF/cAS1Ir5E3kWWzB1EUyjtIxzVRRrWBG XI4h6P7HRlIDbPL4kn11QPL+OMvMZ/Tg8DTCintZm9Ixsn3MpvQY8CqItfBeY4RfKfo3 3m8A== 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=eFVwLS4HPN4oqr0mH+SQHWdJFcIbsw3m7YyR83VCRKI=; b=jKRpSEnkFGYWXv66Vr6GvAvQFXlaI4Jqt13AP9HGy3QVt/EMQS9CgJ3YRjBfoFRnbp nILeXRi8aDbx64dBMcIwMdV3C5b0i2yL4LY9yQ6PkY7DtKaT63yOLa3W1MoNOBVvkuV9 cM/ngS1b6llk3aZ2LjU6+aLV+RqRF2infIzhe23ikLmhDDZqAwOpZFWxURXHgrRz2Dgt gMXSKmmJ613Ahjx4wrJyoFe+mbrGxYYNv6owde77W3i9FjfPFBw/XAJXN4NHu78DdA07 ci40G1Wa6dcwE1EwiZgJMARUr/EolqPv+5tCK9jrEbAIezLJQ+vXEXKR1V/8ERjmbVU+ 41hA== X-Gm-Message-State: AGi0Pub3g3Nl67A7k2ZSoka2WHjMLOB44U1D1y3BqarhJwug4u3hPDqJ W5P20MGqh1oOOL1jIHU+INbD0hdVX8wVDg== X-Google-Smtp-Source: APiQypKr9oxIrWwX1ClKwiSKo+IkX4EmRA9vvdsZGGHwGVClgQrJKAr+fmlauHglC/+v336hPvIypw== X-Received: by 2002:a2e:998c:: with SMTP id w12mr3068945lji.57.1587150627577; Fri, 17 Apr 2020 12:10:27 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 3/6] target/microblaze: Add the div-zero-exception property Date: Fri, 17 Apr 2020 21:10:19 +0200 Message-Id: <20200417191022.5247-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417191022.5247-1-edgar.iglesias@gmail.com> References: <20200417191022.5247-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::243 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the div-zero-exception property to control if the core traps divizions by zero. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- target/microblaze/cpu.c | 2 ++ target/microblaze/cpu.h | 1 + target/microblaze/op_helper.c | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 36c20d9724..7a40e2fbad 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -280,6 +280,8 @@ static Property mb_properties[] =3D { 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/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/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) =20 static inline int div_prepare(CPUMBState *env, uint32_t a, uint32_t b) { + MicroBlazeCPU *cpu =3D env_archcpu(env); + if (b =3D=3D 0) { env->sregs[SR_MSR] |=3D MSR_DZ; =20 - 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] =3D ESR_EC_DIVZERO; helper_raise_exception(env, EXCP_HW_EXCP); } --=20 2.20.1 From nobody Sun Feb 8 21:23:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587150710; cv=none; d=zohomail.com; s=zohoarc; b=SHK9M3Y9/9MCn1m9zi+THf2U8/rvixNQSJ0eGg5AvMm41JZNcPfDOvwSa0QexKMwRt9OF/RZybQWKteUYGt3voQEvaFihdFQNbeJIxTBlsY1UN3vVAiuV9UvvZBgT4y00um72ggX3GnWD2u4DC3BGM04MmD5En9sSWJ3uH9UWng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587150710; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j6qAH/yc9ASWu022edKXnrycRFAgkzUAnHYobHnSqsw=; b=Ctw4oKav/FtO8zQD2LBmIyUTLdeJ+nzLLBvaoGSJp90NSOJTXtI363x9LTh1eXSzAbycpLhTydUmae2EylNXFo3SUSDpP40NhTNMbUAPY7e7ZHWTZo2G/4ZBdmTGABL+MIHeCtCnq/om5l+x7i2hEFJnXP5d+dzPjgJ6qMKCKPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587150710842435.35724385959634; Fri, 17 Apr 2020 12:11:50 -0700 (PDT) Received: from localhost ([::1]:50962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWOz-0003gw-Go for importer@patchew.org; Fri, 17 Apr 2020 15:11:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54320) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWNk-0002iQ-5T for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPWNi-0005NO-Va for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:32 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:44655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPWNi-0005Lw-Nj for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:30 -0400 Received: by mail-lj1-x244.google.com with SMTP id z26so3134735ljz.11 for ; Fri, 17 Apr 2020 12:10:30 -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 6sm18697919lfy.97.2020.04.17.12.10.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:10:28 -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=j6qAH/yc9ASWu022edKXnrycRFAgkzUAnHYobHnSqsw=; b=dqXPKC359jSI4EApqsfrPY1xSRvW+3EEL7xTo4WcjXKn1pTYLRjAHgjr97aTEjm6vs L/llYbh367vpzBMihjUY4B1bgXhbq+1cFlbAhhktlr8sNtDKiWvTO71REjPhCOqMkRl6 UEJ62x+GTZYpg+mOiYIX9LDdiBOrmuq8qhk/JmcpnCedR0kFKXR6Tsk0rsj5wNhZ/u5B DiCD64KG+RCpNjWIpa7CUWRLAaQron8jeQsrnhb8XUl7A99t1NjU8cC/InxCoCSiSmbi UBsp0yemeyU+yqdW3pQkmODNepqSWMy9hz2qfPUTLetS4L5BIb6Dw0T6q63MoRatDTQM EUEA== 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=j6qAH/yc9ASWu022edKXnrycRFAgkzUAnHYobHnSqsw=; b=JK7k1TR8RbE/yGsAlxKs7xGd87VHa4Z2l+hU5MxQKYEeB+sBcmKuU7hbnV8Lkd1NGN VxY7qTaBJSRZBIAF91UuxQjjmC1rlR88w067a5Is8ALgfWsvJEOVthC4+cIWvbbXtO4y swgHDknhw8tGwGQoY/W77dmntrPSEM7wTQO9ZYXNp4iR4A97cS0YSaj/A44qwxhcw+zd pWrRA0DTT3w6K65BqjyLh5IO92Rut0ZCRQ0BWdaoPgwx7Ftf8KBf99+ar3+71YYIYplE 0Ctfxf7+8MYaargbYPY8QwL1ZgkpR7hE6U/+P71mJsJ44QxWBN+JSLLFMEL51zG75rlL Wtmg== X-Gm-Message-State: AGi0PubQ44KPKEO+OnDcMkclp8M0igcqiogHs9k9MxhN9lP80Ocrbjmp sPXhF72pGU9LN6DpXALcXh34PM/+NTO+Qw== X-Google-Smtp-Source: APiQypLSg9SB9K5Paqtq2nr1NTgZRvRIPbzXnRnJb33wPJ3q/Z8+xg/GLMOzaDK98dYaHLkJNBYUhg== X-Received: by 2002:a2e:9752:: with SMTP id f18mr3084673ljj.181.1587150629170; Fri, 17 Apr 2020 12:10:29 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 4/6] target/microblaze: Add the unaligned-exceptions property Date: Fri, 17 Apr 2020 21:10:20 +0200 Message-Id: <20200417191022.5247-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417191022.5247-1-edgar.iglesias@gmail.com> References: <20200417191022.5247-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::244 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the unaligned-exceptions property to control if the core traps unaligned memory accesses. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/cpu.c | 4 ++++ target/microblaze/cpu.h | 1 + target/microblaze/translate.c | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 7a40e2fbad..a850c7b23c 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -209,6 +209,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **= errp) PVR2_IOPB_BUS_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); =20 @@ -282,6 +284,8 @@ static Property mb_properties[] =3D { 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/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/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 =3D tcg_temp_new_i32(); tcg_gen_qemu_ld_i32(v, addr, mem_index, mop); =20 - if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + if (dc->cpu->cfg.unaligned_exceptions && size > 1) { TCGv_i32 t0 =3D tcg_const_i32(0); TCGv_i32 treg =3D tcg_const_i32(dc->rd); TCGv_i32 tsize =3D 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); =20 /* 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 =3D tcg_const_i32(1); TCGv_i32 treg =3D tcg_const_i32(dc->rd); TCGv_i32 tsize =3D tcg_const_i32(size - 1); --=20 2.20.1 From nobody Sun Feb 8 21:23:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587151129; cv=none; d=zohomail.com; s=zohoarc; b=HSJe+BbGW7BC1GUiMAPGjsDqt9OweQ0SlEJIMgsEiGUnvXZSGaFxmBc0obay9SoJiEc7XJdI/6E18puEmLGJCwdrGXr0urHTNlrSSofTwUmyiYO6yV0LghPrWHacpEpUKcYllFajn/FEwz0DOS3bSzbN4ai29vOBXYpLuYuZHBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587151129; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=b0T2/yc1VAw0adGUFTBuH3ADGJB4Oe5EFs26KUSMiuM=; b=lcwlDudY2oIAFMjbfdTLCQtVWbOml1dqvauj6Sj/e8IIIGXmKBGAFD30BOy8GttegydCrN7AyEF+0xlYMOE2IhOhbiS0EjcHFNQGNaennjWt50KLucXZ7hjdKaB9/2LImGa+lNG71HubOwajIHRCpXhd1hdqT6BK4maFlqyyMiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587151129598767.1911399504373; Fri, 17 Apr 2020 12:18:49 -0700 (PDT) Received: from localhost ([::1]:51044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWVk-0002aN-Cb for importer@patchew.org; Fri, 17 Apr 2020 15:18:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54389) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWNo-0002kd-88 for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPWNm-0005Sd-Jp for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:36 -0400 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]:42596) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPWNm-0005OB-98 for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:34 -0400 Received: by mail-lf1-x141.google.com with SMTP id j14so2674037lfg.9 for ; Fri, 17 Apr 2020 12:10:32 -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 t3sm10315665ljo.51.2020.04.17.12.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:10:29 -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=b0T2/yc1VAw0adGUFTBuH3ADGJB4Oe5EFs26KUSMiuM=; b=iU5LuAPEAiAcKmCa5oMGgOhjsHU3rwQm7FNmnqvT8wimQz1CfftyGGtszKRvmsZk8t gmLiHKUMNYYi1izmtNmKqE4V7IE6NYp7M5jI9OIWxxZgcBNPW8+Ab6CbY1Wn0hF7mlwe 4KxOUMQOBR+vEPFnkfoxxT9+mBVJ6kuB/t3px9m4l/KtkRzunhl8VFNvieEx1Bk05CWz XkIldc5BJUCn/x88x1IGKYBT9YxuIQ1kSpFa5xT2KgnAKg7rJpP7j/9AaTJobMZqLczJ Edkpuc1XqDeUJX0sYx29CbHg2x2VivUW9LMsxrUa5pPnjaWVgN7U2As691cFg0kFNZSJ B3yw== 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=b0T2/yc1VAw0adGUFTBuH3ADGJB4Oe5EFs26KUSMiuM=; b=SLHl2BY/c/sDn7od4DujAb22SWpHk7twoeXNs2rTSd/ptCPqSaoKAO11X/uOQOWAe6 BmIwM5zbb5g1/NULb1X6qAlZpnNfJvsjUjwZQQJFn5+FP9QilHfGQVNpLe1xi4iqxEF5 dzqM698VzMLw0YG/rbNPeqWDd3knLCB3/t2VGj86EWb5gWJaG6DNKTrORPdtdyCF2Lq5 zQDnrGg0tzhPpwwphU0fc8/xVwvAjJypTB60vUVGpDLXWNnxJRRlq4Fpv4fy/X9wdUWG 4a2fo8J/bVMAS7AC0BL/KL8p2ZOKPTaGeySgYaiTmnm82RZo8PhYOKmvlXLpvqmWLIAy vDjg== X-Gm-Message-State: AGi0PuYqqiBT80CjGxNiHDMQI36eu4MVnfQ9VwlvdgP58uCedaI9krmq QeM30hjmRu5mgop6xbLvB4x1YGLjKrpvhA== X-Google-Smtp-Source: APiQypJZFjRkH7WKP1XTv60yjUL5kUhmpFEbJ+6izpKRd2JgIISgjkSxYnskUuebf8ZBkQwDnNXi0A== X-Received: by 2002:a19:224e:: with SMTP id i75mr3019832lfi.22.1587150631056; Fri, 17 Apr 2020 12:10:31 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 5/6] target/microblaze: Add the pvr-user1 property Date: Fri, 17 Apr 2020 21:10:21 +0200 Message-Id: <20200417191022.5247-6-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417191022.5247-1-edgar.iglesias@gmail.com> References: <20200417191022.5247-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::141 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the pvr-user1 property to control the user-defined PVR0 User1 field. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/cpu.c | 4 +++- target/microblaze/cpu.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index a850c7b23c..0759b23a83 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 =3D=3D C_PVR_FULL ? PVR0_PVR_FULL_MA= SK : 0); + (cpu->cfg.pvr =3D=3D C_PVR_FULL ? PVR0_PVR_FULL_MA= SK : 0) | + cpu->cfg.pvr_user1; =20 env->pvr.regs[2] |=3D (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0) | @@ -290,6 +291,7 @@ static Property mb_properties[] =3D { 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(), }; =20 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; --=20 2.20.1 From nobody Sun Feb 8 21:23:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1587150846; cv=none; d=zohomail.com; s=zohoarc; b=N31qvJl41buWQt6+6z6DCsQ4bEjmiiE3BMXn726TVj6X6BaoRL9YXu7Uc07Y/hxN5FLdRG6oTrj1hfoqJb91zGnzAEje2s2CfZcJ6KTaa7ADdMn0oIKf5BFViCuBIrpcsjyDBprK6ZE1xecrcf7iNEZLbK/gtVX76OjCCLvSHFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587150846; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uErXPxJ2vzEoeE7Q7TmBVLR2V1xZy4c+Qn/k8aZPlVg=; b=frJ7HSLLLlxundkXFeOH8ntDMgiU4vcxYt/FRM0ApZeVCKGIZK5FZuPLvWmFIHeAVb7iWg8Ee6pzpZWmc95P7vl82OIRlAktE8g8TugOkt4EZDumxLfhxgWb5wksz5ZH72G1wFu/BjRS4SoZcczm5LqWM4fss8g7LW8QJGiD3N4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1587150846337360.8574061257659; Fri, 17 Apr 2020 12:14:06 -0700 (PDT) Received: from localhost ([::1]:50976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWRB-0006Z4-05 for importer@patchew.org; Fri, 17 Apr 2020 15:14:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54391) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPWNo-0002kf-8G for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPWNm-0005Si-Jz for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:36 -0400 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:45327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPWNm-0005Ps-Ah for qemu-devel@nongnu.org; Fri, 17 Apr 2020 15:10:34 -0400 Received: by mail-lj1-x241.google.com with SMTP id v9so3134520ljk.12 for ; Fri, 17 Apr 2020 12:10:33 -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 i20sm19545732lfe.15.2020.04.17.12.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:10:31 -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=uErXPxJ2vzEoeE7Q7TmBVLR2V1xZy4c+Qn/k8aZPlVg=; b=aiYW2rhMJUm4ZA5Uo7Dv5X5l1Ic1TGm1Ilcptr8T7WdxMoQs415/Woui5qY/N7QzEw ivgCYgh7S37p4BHbyH76qkY2/6EdnKH3HxRUCqXSCIBx9JO1yYrU7nyXiESVZbOnnb/p A4O0hNl9YnpitdCPLsSrdVwHXng0Ycn6t6kXGYrrjj40spuohyH760ksKwutL0wQE0t8 8ABCLoGCN2VWF3a8ONCmpR6+zQ1zy7wWdiyFqeHre2qvXsdU8hmsmQ6t7GOpWtvnvMxU 10k05sLJsI71H/UucBrXXGlpanB31qe4jJnm8T21Xfrq1RckhtQ+dN8noawa5B1C1bx6 g1EQ== 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=uErXPxJ2vzEoeE7Q7TmBVLR2V1xZy4c+Qn/k8aZPlVg=; b=seiZH4krlmRj/jqW27nqBCWR1z8rrtQl/4NVlbaH2CZCDcER+vv0HQQQI7aAgy6sls KhvuGH6CXwXmqOCDQskgVqZMapD28q1cLHZAZi3mB2aI/uqmHdmWyN4cS1rjzaR35DKE Y7noqN2LQQ5EpIeJZo+oXgMFIJLPYAEk1jq2D0AvdW2pwMN2DvTIfssbULpzYRS3njQ4 o+8TNdIdqZ5Rv5CMzjjhxlRg7uz0TLfuNoHCu5OZ8NSGWuli9Kq2K++aNLzhsVPNZAjn DP9UhhLiLl/6dfHaM+ndr12IlGay032XcrlU/0oj1ELxuNff+ZBcdImLMBBdoAj4GMQO 44MQ== X-Gm-Message-State: AGi0PuaYu4NZfX0066zWbRledGEM1/8OjVymAgt0euNkLedZEfXK5iOt BTU4gOo8NZi6Lvxb6v8BsTaxeD+bIgPpXA== X-Google-Smtp-Source: APiQypKLjN2QTbIjOW9Kl4JZKVvzsIwxHP9fJ1mDMTweYUtx5WT8WN746kLB3r2kT2j/Rx2e0jtUrQ== X-Received: by 2002:a05:651c:1209:: with SMTP id i9mr2789556lja.250.1587150632206; Fri, 17 Apr 2020 12:10:32 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 6/6] target/microblaze: Add the pvr-user2 property Date: Fri, 17 Apr 2020 21:10:22 +0200 Message-Id: <20200417191022.5247-7-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417191022.5247-1-edgar.iglesias@gmail.com> References: <20200417191022.5247-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::241 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the pvr-user2 property to control the user-defined PVR1 User2 register. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/cpu.c | 2 ++ target/microblaze/cpu.h | 1 + 2 files changed, 3 insertions(+) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 0759b23a83..d024ec80eb 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 =3D=3D C_PVR_FULL ? PVR0_PVR_FULL_MA= SK : 0) | cpu->cfg.pvr_user1; =20 + env->pvr.regs[1] =3D cpu->cfg.pvr_user2; env->pvr.regs[2] |=3D (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) | @@ -292,6 +293,7 @@ static Property mb_properties[] =3D { 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(), }; =20 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; --=20 2.20.1