From patchwork Fri Jan 4 14:28:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10748387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12DF86C5 for ; Fri, 4 Jan 2019 14:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0087D2843B for ; Fri, 4 Jan 2019 14:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E76F828358; Fri, 4 Jan 2019 14:29:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,FSL_HELO_FAKE,MAILING_LIST_MULTI autolearn=no version=3.3.1 Received: from listsout.gnu.org (listsout.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C8CF228358 for ; Fri, 4 Jan 2019 14:29:11 +0000 (UTC) Received: from localhost ([127.0.0.1]:35885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfQTG-0000hb-SI for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 Jan 2019 09:29:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfQSa-0008W3-I1 for qemu-devel@nongnu.org; Fri, 04 Jan 2019 09:28:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfQSY-0000om-2T for qemu-devel@nongnu.org; Fri, 04 Jan 2019 09:28:28 -0500 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:43631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfQSX-0000fl-I9; Fri, 04 Jan 2019 09:28:26 -0500 Received: by mail-lj1-x242.google.com with SMTP id q2-v6so32560611lji.10; Fri, 04 Jan 2019 06:28:19 -0800 (PST) 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; bh=WKrrI0oBy+W58hCUGq5Y4qBBKMwsRVtrW3gEic4Iodg=; b=nQVZ9SuCSm/QZDL2BWnwXAw1LKuqm8DPg/hl2gpUPsJ+80xcbcC4Mi1zqQznNpaTWx AVjDfa75XAHrl2wwkBRwdPhgfBF7afINUmDcOKLJegjDZZzx+DZeqplXxl0Klbl52V8M RA+bhEDLRLeZ3Ez29D2qH9C4UNd9KCAvVrsbHBX/AkIL+/S/HgVOOsHb28rmLdnOytj/ xtpnMyfF42FMBjE2Cx8i9W1mwh3iYhCi8miqtLR0D3ddyEiFw8QUsDHIo+MsCbGdLQxX iNGDBLbgY5KEX0Va06TkLP493JM+gxQkTKGZe5GMgCObgfTaYURFd2c6Epf/ajH1+YD8 JqOw== 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; bh=WKrrI0oBy+W58hCUGq5Y4qBBKMwsRVtrW3gEic4Iodg=; b=OCSD8thMKotgyyTXfnomtoR2WGojYEzO6Db8/8SbC0x6VEl82EN9rHm0QZT27pMNCa oO8qI2JTXlYqNJCPXP65zYxIVCGT4Y9zqDiMvLGzc78KKAy22tx+2bXYL8xQP/jWOIxr c7XNt2vjYgTIALBYaA5dljEQKez5lMZjKj0Uq8iXcm++ymSPnOdgS++krErmvUMenQ+c RjgaxvcYUtooKFCPaX/nyf4nYkj7TRfo3xVQxVWuywoh3dElBnLZrh8JOyQpuMQsup0T DbYjJ9aa88RL4lVfw3BakXBB8Qr9zlOYJDkDJIKQ9e07XFpYoRdRYaLC4tSQeiQGPFzY gNZg== X-Gm-Message-State: AJcUukdw3wR2I55NSpzHAxlklvIKkLe63bunkpi3Er6TanSYtgFGLKeJ Ba1aAOBOsMLaC6+3o/yyp8ayjI/ZV4g= X-Google-Smtp-Source: ALg8bN6lOVQLRrZmNVlvc0CIarZuqk2acdXbi06akjUAqiYydqOYPftZ0TEDPsenVI7XPEbAykx5vQ== X-Received: by 2002:a2e:81d3:: with SMTP id s19-v6mr17143462ljg.138.1546612097795; Fri, 04 Jan 2019 06:28:17 -0800 (PST) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id h22-v6sm9332938lji.45.2019.01.04.06.28.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jan 2019 06:28:16 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Fri, 4 Jan 2019 15:28:12 +0100 Message-Id: <20190104142812.20444-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104142812.20444-1-edgar.iglesias@gmail.com> References: <20190104142812.20444-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::242 Subject: [Qemu-devel] [PATCH v1 2/2] target/microblaze: Add props enabling exceptions on failed bus accesses X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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, 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" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Add MicroBlaze CPU properties to enable exceptions on failed bus accesses. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/cpu.c | 12 +++++++++++- target/microblaze/cpu.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 49876b19b3..5596cd5485 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -202,7 +202,11 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.use_barrel ? PVR2_USE_BARREL_MASK : 0) | (cpu->cfg.use_div ? PVR2_USE_DIV_MASK : 0) | (cpu->cfg.use_msr_instr ? PVR2_USE_MSR_INSTR : 0) | - (cpu->cfg.use_pcmp_instr ? PVR2_USE_PCMP_INSTR : 0); + (cpu->cfg.use_pcmp_instr ? PVR2_USE_PCMP_INSTR : 0) | + (cpu->cfg.dopb_bus_exception ? + PVR2_DOPB_BUS_EXC_MASK : 0) | + (cpu->cfg.iopb_bus_exception ? + PVR2_IOPB_BUS_EXC_MASK : 0); env->pvr.regs[5] |= cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -265,6 +269,12 @@ static Property mb_properties[] = { DEFINE_PROP_BOOL("dcache-writeback", MicroBlazeCPU, cfg.dcache_writeback, false), DEFINE_PROP_BOOL("endianness", MicroBlazeCPU, cfg.endi, false), + /* Enables bus exceptions on failed data accesses (load/stores). */ + DEFINE_PROP_BOOL("dopb-bus-exception", MicroBlazeCPU, + cfg.dopb_bus_exception, false), + /* Enables bus exceptions on failed instruction fetches. */ + DEFINE_PROP_BOOL("iopb-bus-exception", MicroBlazeCPU, + cfg.iopb_bus_exception, 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 03ca91007d..792bbc97c7 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -308,6 +308,8 @@ struct MicroBlazeCPU { bool use_mmu; bool dcache_writeback; bool endi; + bool dopb_bus_exception; + bool iopb_bus_exception; char *version; uint8_t pvr; } cfg;