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: 284179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BED4C54FD0 for ; Mon, 20 Apr 2020 17:54:27 +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 5DF4B20B1F for ; Mon, 20 Apr 2020 17:54:27 +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 5DF4B20B1F 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+qemu-devel=archiver.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 1jQack-0008R6-GX for qemu-devel@archiver.kernel.org; Mon, 20 Apr 2020 13:54:26 -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+qemu-devel=archiver.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: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: 284178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3650C3815B for ; Mon, 20 Apr 2020 17:54:40 +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 B2DFB20B1F for ; Mon, 20 Apr 2020 17:54:40 +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 B2DFB20B1F 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+qemu-devel=archiver.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 1jQacx-0000MG-MI for qemu-devel@archiver.kernel.org; Mon, 20 Apr 2020 13:54:39 -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+qemu-devel=archiver.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;