From patchwork Mon Apr 20 17:52:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11499537 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C59B913 for ; Mon, 20 Apr 2020 17:56:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F77420B1F for ; Mon, 20 Apr 2020 17:56:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ai+tR+BP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F77420B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQaea-000400-4t for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Apr 2020 13:56:20 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the opcode-0x0-illegal CPU property to control if the core should trap opcode zero as illegal. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.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); env->pvr.regs[5] |= cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -274,6 +276,8 @@ static Property mb_properties[] = { /* Enables bus exceptions on failed instruction fetches. */ DEFINE_PROP_BOOL("iopb-bus-exception", MicroBlazeCPU, cfg.iopb_bus_exception, false), + DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, + cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), DEFINE_PROP_END_OF_LIST(), diff --git a/target/microblaze/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); if (ir == 0) { - trap_illegal(dc, dc->cpu->env.pvr.regs[2] & PVR2_OPCODE_0x0_ILL_MASK); + trap_illegal(dc, dc->cpu->cfg.opcode_0_illegal); /* Don't decode nop/zero instructions any further. */ return; } From patchwork Mon Apr 20 17:52:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11499529 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8C52913 for ; Mon, 20 Apr 2020 17:54:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7916D20B1F for ; Mon, 20 Apr 2020 17:54:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YEKsPha5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7916D20B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQacR-0008R6-EV for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Apr 2020 13:54:07 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the ill-opcode-exception property to control if illegal instructions will raise exceptions. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.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); @@ -276,6 +278,8 @@ static Property mb_properties[] = { /* Enables bus exceptions on failed instruction fetches. */ DEFINE_PROP_BOOL("iopb-bus-exception", MicroBlazeCPU, cfg.iopb_bus_exception, false), + DEFINE_PROP_BOOL("ill-opcode-exception", MicroBlazeCPU, + cfg.illegal_opcode_exception, false), DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), diff --git a/target/microblaze/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); } From patchwork Mon Apr 20 17:52:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11499531 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79E00913 for ; Mon, 20 Apr 2020 17:54:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FED820B1F for ; Mon, 20 Apr 2020 17:54:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fnClG/dB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FED820B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQacV-00009R-FS for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Apr 2020 13:54:11 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the div-zero-exception property to control if the core traps divizions by zero. 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[] = { 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) static inline int div_prepare(CPUMBState *env, uint32_t a, uint32_t b) { + MicroBlazeCPU *cpu = env_archcpu(env); + if (b == 0) { env->sregs[SR_MSR] |= MSR_DZ; - if ((env->sregs[SR_MSR] & MSR_EE) - && !(env->pvr.regs[2] & PVR2_DIV_ZERO_EXC_MASK)) { + if ((env->sregs[SR_MSR] & MSR_EE) && cpu->cfg.div_zero_exception) { env->sregs[SR_ESR] = ESR_EC_DIVZERO; helper_raise_exception(env, EXCP_HW_EXCP); } From patchwork Mon Apr 20 17:52:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11499535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98467112C for ; Mon, 20 Apr 2020 17:56:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BC5920B1F for ; Mon, 20 Apr 2020 17:56:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HNvt03Ft" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BC5920B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQaeR-0003iO-Jz for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Apr 2020 13:56:11 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the unaligned-exceptions property to control if the core traps unaligned memory accesses. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.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); @@ -284,6 +286,8 @@ static Property mb_properties[] = { cfg.illegal_opcode_exception, false), DEFINE_PROP_BOOL("div-zero-exception", MicroBlazeCPU, cfg.div_zero_exception, false), + DEFINE_PROP_BOOL("unaligned-exceptions", MicroBlazeCPU, + cfg.unaligned_exceptions, false), DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), diff --git a/target/microblaze/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 = tcg_temp_new_i32(); tcg_gen_qemu_ld_i32(v, addr, mem_index, mop); - if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + if (dc->cpu->cfg.unaligned_exceptions && size > 1) { TCGv_i32 t0 = tcg_const_i32(0); TCGv_i32 treg = tcg_const_i32(dc->rd); TCGv_i32 tsize = tcg_const_i32(size - 1); @@ -1110,7 +1110,7 @@ static void dec_store(DisasContext *dc) tcg_gen_qemu_st_i32(cpu_R[dc->rd], addr, mem_index, mop); /* Verify alignment if needed. */ - if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + if (dc->cpu->cfg.unaligned_exceptions && size > 1) { TCGv_i32 t1 = tcg_const_i32(1); TCGv_i32 treg = tcg_const_i32(dc->rd); TCGv_i32 tsize = tcg_const_i32(size - 1); From patchwork Mon Apr 20 17:52:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11499533 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C61A112C for ; Mon, 20 Apr 2020 17:54:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1212F20B1F for ; Mon, 20 Apr 2020 17:54:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CR2EZtfb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1212F20B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQach-0000MG-2F for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Apr 2020 13:54:23 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the pvr-user1 property to control the user-defined PVR0 User1 field. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.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 == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0); + (cpu->cfg.pvr == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0) | + cpu->cfg.pvr_user1; env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0) | @@ -292,6 +293,7 @@ static Property mb_properties[] = { cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), + DEFINE_PROP_UINT8("pvr-user1", MicroBlazeCPU, cfg.pvr_user1, 0), DEFINE_PROP_END_OF_LIST(), }; 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; From patchwork Mon Apr 20 17:52:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11499543 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12D7A913 for ; Mon, 20 Apr 2020 17:58:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DAA2E20CC7 for ; Mon, 20 Apr 2020 17:58:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sbx3Uu14" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAA2E20CC7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQagT-0007QM-2C for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Apr 2020 13:58:17 -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) 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) 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Add the pvr-user2 property to control the user-defined PVR1 User2 register. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.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 == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0) | cpu->cfg.pvr_user1; + env->pvr.regs[1] = cpu->cfg.pvr_user2; env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0) | (cpu->cfg.use_hw_mul ? PVR2_USE_HW_MUL_MASK : 0) | @@ -294,6 +295,7 @@ static Property mb_properties[] = { DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), DEFINE_PROP_UINT8("pvr-user1", MicroBlazeCPU, cfg.pvr_user1, 0), + DEFINE_PROP_UINT32("pvr-user2", MicroBlazeCPU, cfg.pvr_user2, 0), DEFINE_PROP_END_OF_LIST(), }; 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;