From nobody Sun Feb 8 18:09:23 2026 Delivered-To: importer@patchew.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=1587405409; cv=none; d=zohomail.com; s=zohoarc; b=RelAuiqRReLJDVTq7VaPL6BIfDBtS215mvLI+9ny7lB6igCwuDnE6ZpJtHDXUrP4BUcZ4wREgizCOyVL7Tmvq5+ain+kQWXyCVxq21Vd9HGtlEYwXgZmNd3by8O3Ni5uJfHsE4lUUbdooNeYiY2NL3quslHq0ia2BiDCgxicRYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587405409; 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=wIXQdHy319V2N/FhegMebf+jwU+zMT4Ec4BdCWpHxiM=; b=Zj2t8r1FPK5q8JXbq7ws9pkgIUF/Lll0NK7bY82tSQJ6z5pEcMbR+rJ1f8BlKWgZ+31zzm2u8oH9YI5g7m62o51Dn9in7jxyK71JoKq1L2zHDOFoLvEcbJ7rXp8Kqu/t/2u3QmVMoxlxNmvkfU8hd2Px6HBI7gkcrTD/LEmsQk0= 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 158740540904463.550863094184024; Mon, 20 Apr 2020 10:56:49 -0700 (PDT) Received: from localhost ([::1]:40018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQaf1-000400-NB for importer@patchew.org; Mon, 20 Apr 2020 13:56:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36556 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQabL-0006fs-La for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:08 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQabI-0003ug-01 for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:59 -0400 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:36340) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQabH-0003s1-JN for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:55 -0400 Received: by mail-lf1-x142.google.com with SMTP id w145so8740166lff.3 for ; Mon, 20 Apr 2020 10:52: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 l12sm83412lfp.35.2020.04.20.10.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:52:52 -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=wIXQdHy319V2N/FhegMebf+jwU+zMT4Ec4BdCWpHxiM=; b=ai+tR+BPFYl9k+EtpSp+7Gi3HDDEip7g6OPUn1A2iB9YmiZYpjH0+XjEgW08YfBJN4 YGUjMZJtxO5t+Zse7EA47Fqej4nJSkrcVgJn4+FtIL1d+CrX5CIdODTXg3G8tEAuyrvx vSzBamDJb8xjHtt0pPUXN8seQ5wcZ/GhHyOC9PVHkcTpyMzysbiyxBZrnQNXsWcSS45Z gZIEv3yQqK5vQG73cGscZ765D45bw5HcX69hzWSA58YcCj3NtASg6TGgk0kkzIGyFlUM qRUp8A685U5rY/ERA6YTEtuUtIVBXLb4UHieiMw3gk/Y+ekgNdwrtuLdGSMEBOBIwzJ0 /Zgw== 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=wIXQdHy319V2N/FhegMebf+jwU+zMT4Ec4BdCWpHxiM=; b=BYZHPJmUc/D+ZMkwiUg1zcdW67c9cgphEsTMXxhH0r+7N0mxiBFrOJgpPHMr7h37BA VEFhXarWz779qCgpv+zRg4b84RJxtNpoIUp//cexZ9rNr9R7GWcCxfdoSp7d1TvBah9j gFaxC7Xk4M4nJmdCIsrNW5Uv375fwVhIIZtvcYRbyGQpnipzaSKylE6aQTJj/vgz80L/ l7C/yjYyaZLR9ozqNi+6z4Rdmv+bKHcpiM5wYY7mAUPhEo+4z2oFlbLoEcmb8T1+VKVB UA5pNIzY7Q5rP8DdDfEDLfuIwYusnZyuL0wRaIFP9tO58kwOq11IfGD8saV/qsG9vBiF 1bAg== X-Gm-Message-State: AGi0PuYGMhbhL6QP61xw9yAC9a5l64gygMqYVKZWNueWWi41jX2S0k1E PTJIRcYQhHXZD1I7nz1AhSqxV+5ZAR4= X-Google-Smtp-Source: APiQypKMIC8/93ysyH9iO5UHbooVa7gY3+sk8v0v8Ejj0J20KITGTff3JkyBu6jUGvectqibk83Idw== X-Received: by 2002:a19:ad45:: with SMTP id s5mr11233854lfd.106.1587405173433; Mon, 20 Apr 2020 10:52:53 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] target/microblaze: Add the opcode-0x0-illegal CPU property Date: Mon, 20 Apr 2020 19:52:45 +0200 Message-Id: <20200420175250.25777-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420175250.25777-1-edgar.iglesias@gmail.com> References: <20200420175250.25777-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::142; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x142.google.com X-detected-operating-system: by eggs1p.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::142 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. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- 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 18:09:23 2026 Delivered-To: importer@patchew.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=1587405273; cv=none; d=zohomail.com; s=zohoarc; b=ZtmeXqp/E4oTrsrsKWB3YtIhmLLrbmN5YvkRg6GGhn94qN0l6pCBC2V9wm58mgas8ZQNC+mwMMjNiP5YbZ4Po4Lu8tI+VwZk7SqK1JNugaSTvcTDPcvB3QXNdxeVctKyiV/vG6YqJKuvIqz5pJjp32R6h84tcRWbkwTB6cTuLck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587405273; 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=jZokMyQsNznnsjTzWlvQibgi/xwwIy5eNYMrDnjS46c=; b=VOT8hxQpQwmuvK3uU0OS5Q42LgTRFkpdSJK+lPbO+rHSAUaZCQ9vB8oAMN1hVz6gS8bHjYTSxQbNf1MsQcHJMP/RKohpj/g4I0zmTwlAIifx7UXL0IHiG4Ue0IiZdCRIZ36CSEMbiT5x7Vkxh3MopZadxSP1/hMGUb8EmWTetp8= 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 1587405273512575.6587239499539; Mon, 20 Apr 2020 10:54:33 -0700 (PDT) Received: from localhost ([::1]:39972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQacp-0008R6-T3 for importer@patchew.org; Mon, 20 Apr 2020 13:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36542 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQabJ-0006dv-V6 for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:58 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQabJ-0003x3-3o for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:57 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:33653) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQabI-0003tl-NW for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:56 -0400 Received: by mail-lj1-x244.google.com with SMTP id w20so4716095ljj.0 for ; Mon, 20 Apr 2020 10:52:56 -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 x11sm126954ljj.15.2020.04.20.10.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:52:54 -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=jZokMyQsNznnsjTzWlvQibgi/xwwIy5eNYMrDnjS46c=; b=YEKsPha5nFuMnYkf6c23MWpXSe04vZ7TEMmqcJoAD4v0aejItRGwMOgdfZAGvcmenO 77akDOqF11dNazQiHrGnRAUDyoh/eEEf0KqeezKLTfy4Ia+AXp/N1Nz+3keV8yFo9sAI Kbw+lnFvI/4KdFPHpc1cofZ46rU/3UjTLoGx4cgYRKK7ml8Ej8FTZSY+/V2WlxRwS2Vj o8zydhWSfdUOCpRdhpDwGNugjXquhrSLpwXp9s8BFqG8VpZGgCB3VmOXbNYZPZLPbM+h 0o98mRRspcCRnMdDPMRZ2A0xNFOVKdQt+XYgNzP7lp+3yHePp9pT1DyKydB7dVAeA2DU zICA== 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=jZokMyQsNznnsjTzWlvQibgi/xwwIy5eNYMrDnjS46c=; b=AmlxuGR5gHm9Zo6rGjF3dgovWO0EE3eibpn+ybKBeyEo8zceyF/eljvmPpZ/mPw9At Lr+ZzwB8LKUZP/y9ViSAbQxc5k9WbCBZ3iM8k/xKbcr2Us1jeeeaFzdTm68OYcOcUm5T 8VyQaKhUVofDyO1F/7nFC/XS5oqhxqaakW4L+uCGxP8RMZmoyZ4y+MbbkqDzTxFooDSr ejtIdMSkf1KF25uP33cGO/3VsEU1X/+R6suQeywviyVkhvW96TKh8q5AJ5RXEKuNgDBv hSwlAPjcSqwvZDeUzM9dvRVSdiSkGp91yBpyOvKmaIfMZ9J9siIXTuswF2a9ENNkThas crpw== X-Gm-Message-State: AGi0PuYiyomd8QwMzUBt1eDnBnXmAe8QIEK/x7K2Jxqem77WkmvvfoXT 8T1vElo/OnHEDiEPVjbIRYtIfRc50og= X-Google-Smtp-Source: APiQypJ4FZzTSxDQuBZ3ht4kYrh27Nw6xpaLEyKdLK7QoOyrJP4KeYiSMoz1KZQONgfNSSqM+uFW2g== X-Received: by 2002:a2e:b4c2:: with SMTP id r2mr6437955ljm.143.1587405174796; Mon, 20 Apr 2020 10:52:54 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 2/6] target/microblaze: Add the ill-opcode-exception property Date: Mon, 20 Apr 2020 19:52:46 +0200 Message-Id: <20200420175250.25777-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420175250.25777-1-edgar.iglesias@gmail.com> References: <20200420175250.25777-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::244; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x244.google.com X-detected-operating-system: by eggs1p.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::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 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.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 18:09:23 2026 Delivered-To: importer@patchew.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=1587405279; cv=none; d=zohomail.com; s=zohoarc; b=fUNowXnskSRkUQz8MiG4iXgxpQkSWyP1JHUI1u7P6URmJZ3UP1idfnYbOZTezkNoJ3TT8QDnCCvAqp/kdtWkuot6uP8xyyGvtNrXhXraNHiDdHftXp/FlvWHHFnjzAVQwlKW4MGJs73LH0HSpCS7Ac2fwyTB6Q8fZAee54Ef7tI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587405279; 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=lIa+NYujIRdCQSAiwPsqbHt3vidArGlASBdrTdsfVAk=; b=aTNAhMFWsPzAvAjStF5oL75coK0nVPU5XK1GpuEYBb06HUaKr4nWRC4s4GW0axkWlDd6RY6uhczmKH/LM+I9I06+St1rJoypDh3bZkA8cZ5XOSqH4x8Y3JxiEj3ZmOekGAL8Q8RjAYcnuQGEtED6KCX7dBWEW5JUu5VraFI4Plg= 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 1587405279416724.9085644350091; Mon, 20 Apr 2020 10:54:39 -0700 (PDT) Received: from localhost ([::1]:39974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQacw-00009R-4H for importer@patchew.org; Mon, 20 Apr 2020 13:54:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36548 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQabK-0006ej-OE for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:59 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQabK-0003zN-6i for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:58 -0400 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]:33416) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQabJ-0003wT-QL for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:57 -0400 Received: by mail-lf1-x141.google.com with SMTP id h6so8762420lfc.0 for ; Mon, 20 Apr 2020 10:52: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 h7sm120349ljg.37.2020.04.20.10.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:52: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=lIa+NYujIRdCQSAiwPsqbHt3vidArGlASBdrTdsfVAk=; b=fnClG/dBahvmawmXN38NLbAduafiM52pQLQSpfDtq6eYnnI3DpgxarO0OflMYUhTo9 3cyQ1H6cV7HXyikHcNo/HlLPlnDAbBXs7NFhbJZPAEW2Go5nvzrg7mrWWU85KfAtswbP J3/xqwXN1/v4SwcIE01pw40XhmzpMeYOwMgp+HAx9fF1OjodHuYW/4LxlybC4Hz++g20 MG6A3Pe8zEFlKVGE3Pd+hK0em3GzqEqdMOX3J/G0DgGf3jSK9E38gRXyGGyBJNW9XP0l AoNvzvsmy/3fRADFwaXO+CKRmYExKPze1xK6tvkvUFbJ5W7Mr9Y1BD+aJfi/7uYJKRyF 8xVA== 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=lIa+NYujIRdCQSAiwPsqbHt3vidArGlASBdrTdsfVAk=; b=fZdJm/XYQhs1C+HiUmslJ6CcT//Pr+ILE4lV8Bk71lfLl0HUB/rI9eFsR+IZhe4VTF si78Jp1P3EQsk6abHD7FbAgEo6V+VU5RjOgEAbIm/3tso/R8o8Ji+kL05697EvDLEM2/ LjAb8yiIdr5Y8a1N1l6Ob6GckfO/nNPY08Y5oOQkYi4hPh2FoUcgpkwjY5GTZGfpz4W3 cjbb9YmWm5LDyiW78lNeTFbf6IWWqnjue2Ik4Ij7cz5C90+16uK9BsDRaxwpMXp55dMB Ipl6D2h3GdUwdazw96/PeYwQGn3g9M/RuAXAiMc+GiP0NYPn7wzeOsCT51x1ZnkQzfqP 1s5A== X-Gm-Message-State: AGi0PuayF5ZXD7EXcO3gT02CbqJI+smkwHiJVb5qWsz+Ty5mYe7CRj3i C3WTOsH6+FlnqBVIi/mtreodPSQyaAs= X-Google-Smtp-Source: APiQypLXoGl8Vd/b0aR2Ub1Us6PB/1Bm+gPCDVaBW+Z/6RvWrT/MW6YtC0d3ZwFBhskr1dSEcf0plw== X-Received: by 2002:ac2:4d10:: with SMTP id r16mr11241063lfi.180.1587405176065; Mon, 20 Apr 2020 10:52:56 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 3/6] target/microblaze: Add the div-zero-exception property Date: Mon, 20 Apr 2020 19:52:47 +0200 Message-Id: <20200420175250.25777-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420175250.25777-1-edgar.iglesias@gmail.com> References: <20200420175250.25777-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::141; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x141.google.com X-detected-operating-system: by eggs1p.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::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 div-zero-exception property to control if the core traps divizions by zero. 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/op_helper.c | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 36c20d9724..53e80f4e5d 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[] =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 18:09:23 2026 Delivered-To: importer@patchew.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=1587405403; cv=none; d=zohomail.com; s=zohoarc; b=YGpeZDbJXRtTK4mDFtuF3yIDzBCuI2AbKLkTfRdoHoIaYS4fRoPMkXaOKBUZxnGdzRRvIT+vIW1I2mYrBOhy07RBQD61e3nZALcBw4D00rFtsJn5JyaiOUITWHNlEAO0FwIFp4gXUqXBpwPKWV6fuForXwu9N7cUAnVgD42OEV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587405403; 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=LaPaoVtThQwYoQG+zx194rpdA5Jb5QupwjNlgtB5GgQ=; b=cVuNe9EYV8O+u5coReBPTYtIJvpPUokU5pRnqHmEaE3yDhzVg42r6FEuWo7Zhhc6FtQtvyga7SKa+nF5Ea5c1up+TiGM1e/O2kGt1XAxRcPbCPL4T/RK6yBKocFU957W/aC6kGwAMn5CF4diKkG5h6HM2XtprVRMGn7uVGXYSnc= 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 1587405403144528.2971057348212; Mon, 20 Apr 2020 10:56:43 -0700 (PDT) Received: from localhost ([::1]:40016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQaev-0003iO-Ph for importer@patchew.org; Mon, 20 Apr 2020 13:56:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36574 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQabQ-0006ml-G9 for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:04 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQabL-00042o-Uu for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:04 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:35442) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQabL-0003zR-Hw for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:52:59 -0400 Received: by mail-lj1-x243.google.com with SMTP id g4so2874643ljl.2 for ; Mon, 20 Apr 2020 10:52: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 g3sm122709ljj.13.2020.04.20.10.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:52: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=LaPaoVtThQwYoQG+zx194rpdA5Jb5QupwjNlgtB5GgQ=; b=HNvt03FthLs3GrZSrOp6vBmEieBjGl8BccPXAU8N6kN/9n2YF0iIIPUaTQkcKekaCu 9R4x6oTIIW6cGhFl5w/YkOFkb09J7wbuEGoz/PEUQAjF+IqgxXqvnqIsrB0ltCvE1BgZ qCsWzVIr7OpaK6iLbOOViUMQ9jjmjO+/FKwvO9v+FHZdu3040/jNEfdRddlMobhavjWI 8t0ZImWnxGceRrFNzTsCe0otLdzqOnF6Dh4cyZD1vxCXWPyO+J9m8RWvKs4adKDJ6Wxi b1HjWQFrOML7bDUZcfZQ5AHDMxlxFBqmQHAP3HjfYZUM0TOjKfJAs8k3mBvtXk1rWsdF hWXA== 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=LaPaoVtThQwYoQG+zx194rpdA5Jb5QupwjNlgtB5GgQ=; b=QZ2bRCDMx1JjwX0LuRN0YxrBni2vxJDtGfbQSitnnabYrm1O7PqnZZQyKYIQioFL78 OQ99Lr85HIHAFqyZ+ubMJLqEtn59ovtGMTZ6rC6cemdNNGWSm3vyaftcyLu2Z7gro9r+ u75jYF1XOi2tpHQ9hpDbc1ESmbR8mWt/INXJmLZ0pFr+D/vW+P4SMLQW4b3qN4dUik0i qaMfGwyu2CfDBR4kwLuaEQr5pC6T6lacw4h2Xyj9Y4ZB/A9218530C6hrsKjmqah7A7/ VVEKnUsoDgQFPqVLX2vPDuQdBDtS2StbL9educUnzUbX6SzHZKSofe7HWi0OVWdq1mEb /UhA== X-Gm-Message-State: AGi0Pubk+CS795bKXIPPhipINGbfDHImk1jJmugAG58uGqlniuDALLiK SDhT340OWrmdGKjcOK9SlJvDC2wqcNw= X-Google-Smtp-Source: APiQypKH6HOyd8BVhoarhfmekiq5Ot8mqyiPho5QIgvDOTpecrXZVnsB0UmNI2CYHcQxuf3Rvox5Jg== X-Received: by 2002:a2e:8046:: with SMTP id p6mr10243326ljg.21.1587405177265; Mon, 20 Apr 2020 10:52:57 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 4/6] target/microblaze: Add the unaligned-exceptions property Date: Mon, 20 Apr 2020 19:52:48 +0200 Message-Id: <20200420175250.25777-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420175250.25777-1-edgar.iglesias@gmail.com> References: <20200420175250.25777-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs1p.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::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 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.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 53e80f4e5d..10d90c64dd 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); =20 @@ -284,6 +286,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 18:09:23 2026 Delivered-To: importer@patchew.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=1587405286; cv=none; d=zohomail.com; s=zohoarc; b=D9BVP4ppHDaeEVhqYFeUY9FiDp2NAf8kxugKHhy6sJNAcPTtiC5/PlK7dicn2ZPqmpz4pKIphgeehQ6srrrluanxJrBchOGegQd4QndQ0lPB8gFUQat8b9XrIZDg5HpuYdscIaAvOS0Ad559zkcAdb5CwuWYPIkza7JmE80csEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587405286; 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=2HDCg3KLDgunzJYC54IcgJKaF3QV6tINgDH3Q/dGrkM=; b=UfciW05cwVVUU4f0nbnK1FOVm5btdUA8Qd/1rOrwgPZxwWpI56uA3yw7uh1N2KqgzyQjft+0FJW5qvGS1oKA1Rqwg7jOG1eWLZXeCRB2iaH315E8Jb5L9CbKWQ+sXFD7ejPhj2L5otZEyToRfA6CqS7AgaWd3DgKp/pS+BKMXD8= 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 15874052866600.7969494285874816; Mon, 20 Apr 2020 10:54:46 -0700 (PDT) Received: from localhost ([::1]:39976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQad3-0000MG-Cv for importer@patchew.org; Mon, 20 Apr 2020 13:54:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36592 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQabU-0006vH-0i for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:08 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQabM-00043m-Rw for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:07 -0400 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]:44107) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQabM-00041d-Fc for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:00 -0400 Received: by mail-lf1-x143.google.com with SMTP id 131so8709597lfh.11 for ; Mon, 20 Apr 2020 10:53:00 -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 s30sm56768lfc.93.2020.04.20.10.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:52: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=2HDCg3KLDgunzJYC54IcgJKaF3QV6tINgDH3Q/dGrkM=; b=CR2EZtfbxLNJ2F8qXKNHrVTiMIFoOuOBuoQFotuEvEgF4KVCIiQrEvpUOQNKBpNBbi u2H60vi1UshSF9mg1+4BFrcft/Yk21jIN60glBQ6tAMAtIjEfeYVK6qIaztCcr3epa0t Sa9vTevJtRdvM5WRTGpEsMFdm04D+vZlzN3Pa1q7p96P0vicjeFHAnesclEGNA9vl45A TGnsnvJR7EpyTEM6BsDBtxeqTDKSl5eGjNYDfw1f5uMSJE3WpyNddjldCSR7YFgt92Yf vW51uWakc7lYVV4g/hohbIE7n5RgjtGYUdpyLmQvIO5J5o9hEk1jHU7qP5y8x9AhpkqN CnUA== 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=2HDCg3KLDgunzJYC54IcgJKaF3QV6tINgDH3Q/dGrkM=; b=nmAU1tSekMyD5/9r7kUkM4b3D5coL31XzK5+sOtqtmNNZR9FxxTU3eiqe726IqvFMd OvIr1Ii+rSVBwLq9OmxfuwQIrwswvk9P8v09jri6PkAgY4JaeWR0XZqWC4grpeS0rkMq MFwuvCyRG43gevVTBMxYwdoZSaishrszX+QJ2Hf1tNrTQrhZoAU4tslHpyXvAbbEfm15 7f84CmIbMUZepZnvJDpJf+6k66Up4cf2V0nydHn+sIdEH21nUCkIU4/sZSPh4pr4NSd5 9MqATg+nP03dprOibQhFYuD6g0huZkgfAsvF8YI3QeP4944h5VBSmkwSIok5qPUS+QOd IFCg== X-Gm-Message-State: AGi0PuaEd1sr/kccPjeJR0X8nLanSE99hyqxOVsPaL1xektP/fDg9pHJ x93+wErTkE2fkKiz/L78viWx8hnpg0I= X-Google-Smtp-Source: APiQypKxOvwCTZMti5ipX7sxOF3DR/E6VK8ltmGjj7AYvxE2tl2unNlmKDCTSXGK4RbfnCpm8afonw== X-Received: by 2002:a19:f611:: with SMTP id x17mr11621650lfe.51.1587405178562; Mon, 20 Apr 2020 10:52:58 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] target/microblaze: Add the pvr-user1 property Date: Mon, 20 Apr 2020 19:52:49 +0200 Message-Id: <20200420175250.25777-6-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420175250.25777-1-edgar.iglesias@gmail.com> References: <20200420175250.25777-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::143; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x143.google.com X-detected-operating-system: by eggs1p.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::143 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. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- 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 10d90c64dd..53027846c4 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) | @@ -292,6 +293,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 18:09:23 2026 Delivered-To: importer@patchew.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=1587405521; cv=none; d=zohomail.com; s=zohoarc; b=IV6LSv7Lhbs/mCEqxihfUdhLXw4ZlZ3AEAN8WndFv7YhkV4iB5oQ67QVETbC61OL/X9Pgs+HLmNxnTTab4qT6c3P3X90qAw9JRwT1++MLe3wUHLLsTTKwkmAY1OWEexTL9cjdt4rmAtv7YIKoWCCHWb9adxW9qgY4tTopoGKyvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587405521; 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=/DrXlXCXCjcKxXaL3UynOI4aoP3LB9wkYq+IB5RRGYY=; b=Ei9893DAm2xo3A9p787QmN1fOKlIh6EVeHXSYbnLjp0EJzdZsqShFhX6LUn/6GM+ap8JAx3T//2kHUgQ2UhILY/qO8aTi80qCEP2kX+2rTRX9A49Wcx8f0NnrTNUCI6qelNvLfCQQak6SPaiOcLfy2Lm9fTkB1hJoBkLVp308P0= 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 1587405521753316.4120520878545; Mon, 20 Apr 2020 10:58:41 -0700 (PDT) Received: from localhost ([::1]:40044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQagq-0007QM-HQ for importer@patchew.org; Mon, 20 Apr 2020 13:58:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36578 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQabR-0006n2-2H for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:05 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQabO-00045a-4R for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:04 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:36172) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQabN-00043N-Nm for qemu-devel@nongnu.org; Mon, 20 Apr 2020 13:53:01 -0400 Received: by mail-lj1-x242.google.com with SMTP id u15so11023106ljd.3 for ; Mon, 20 Apr 2020 10:53:01 -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 s7sm79548lfb.40.2020.04.20.10.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:52:59 -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=/DrXlXCXCjcKxXaL3UynOI4aoP3LB9wkYq+IB5RRGYY=; b=sbx3Uu148od2PhVUlI0IFX9GYw3j0gFxWulYVrKsBZT5ZfuB3gy0FAQqLL/uSrxahx itYj7icQWe0XB8NqDOPySKW+9L/ljHuHHy+ketJOewy+t80v9wsOz0LhLrjiDEQT0Edp E7vd/kSsyGSl8jgE5vRAydkfoChxWp4V+SEwrUvnADdYemz36AysBxlT/l8hEf3195cj wUbsBqdbRQyrmphrdrMhMT7UL4Uh+d12yPGeotM8m48nA+bFP5egXRm3sDdonqe839TI RdiW7b2ezv4mfDKClxga3h8W5oV8vYjkKRQug8CKSxzmsdA4wAsHBm2ekqrxqX3jIwDd 9EEw== 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=/DrXlXCXCjcKxXaL3UynOI4aoP3LB9wkYq+IB5RRGYY=; b=UBbVoCOR2W/qCChPE8UI/YYBP81T//XL28z6Xqs2S/QpvyeoHeRPZZsFoZrAG4N6uW jQmW15hnPC9Ba5A3vcStttm6AKYSwoJSUCU22mzvQpV7J0FYxHH3n23yJuvXCv0zjiAi FjKn9p6Spn1xo5duPcRtQQfxd5UsvYbhW1nxZNcKRM8hHo4GxLo55pf7ZUHRRP3SGRH6 Tnqsy5RIF3rIpthKF73yQZRbhTRiyFKtMuRM15O59YINwOYZxZOPZhd02hr7G+5MpZ0N 2vm1Sa5sxGoOaema7m+uHQFCIc6hxP4xHTcu48g7G0zFWxDkF8Lw4l4BTooUlIsoI/1L L3FQ== X-Gm-Message-State: AGi0Puaf/qdfFa9DqxwEDeymOiUdfwQVQP2ik+0lr/1X0JncFVuLPPny ZzGmsuxXX48deAsTmwrRS2J1kb4d6HY= X-Google-Smtp-Source: APiQypKq25z8WYE/aRkch683i5iyuTbIfI0TVx0ph7gblDlRnCgn3y7XwVWXOQBimhp3i069YWPgMw== X-Received: by 2002:a2e:9886:: with SMTP id b6mr11205677ljj.237.1587405179944; Mon, 20 Apr 2020 10:52:59 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 6/6] target/microblaze: Add the pvr-user2 property Date: Mon, 20 Apr 2020 19:52:50 +0200 Message-Id: <20200420175250.25777-7-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200420175250.25777-1-edgar.iglesias@gmail.com> References: <20200420175250.25777-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs1p.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::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 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.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 53027846c4..22d08dc8cb 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) | @@ -294,6 +295,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