From patchwork Tue Jan 22 12:20:46 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: 10776259 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 2B2971399 for ; Tue, 22 Jan 2019 20:56:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1676D2B7D4 for ; Tue, 22 Jan 2019 20:56:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06BDC2B879; Tue, 22 Jan 2019 20:56:44 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.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 801C62B7D4 for ; Tue, 22 Jan 2019 20:56:43 +0000 (UTC) Received: from localhost ([127.0.0.1]:49621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm36A-00031l-6a for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Jan 2019 15:56:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm1r4-0002el-Tm for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:37:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm1r2-0004B9-97 for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:37:02 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:35196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gm1qx-00043p-6Y for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:36:57 -0500 Received: by mail-pl1-x630.google.com with SMTP id p8so11974376plo.2 for ; Tue, 22 Jan 2019 11:36:52 -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 :mime-version:content-transfer-encoding; bh=7AMoONMkuWyVTCRjWs5bYL2pa5Dg6sAqJ865V0R8X/k=; b=sh8wG4XHKJCljlVFliKeMMUv9bcuDUPRee/Olvv+abnaZZDsceY1Pm3FH7ONa0GSdc PX2F8AGz9vajL0lmSdx6t3PyTfPtNQuGSCDOVYOfQk36CI432JPRL2ZP3KrwtzqLueln 0jkGBGJCeOFnR1vk9X1NInkXjh5APmeCvN/xnhXQBbfVL+oTHLz1itMSFcHw3DG+ip2g pPqrUEcnbA71yDv8c9mmag2XEC6rcYV/E7SvJIY58Zc4pshaCgwP4hMq2Eo64JOPbLOx Ob9ZcUIxM4LaLjRuGy64XrsiZk1J6ft2KIoBgntb43PbOQuAqhNIwT6GyYDRUkAZs/Uy PC6w== 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=7AMoONMkuWyVTCRjWs5bYL2pa5Dg6sAqJ865V0R8X/k=; b=AzAVdryueNrMmRwNBmc3Zwr8RHYm5vuH8RXeRBYsf6PIEtQ03ifLDCcQBu16IDU0hR iz7ub86BDaFufuC9T2ghgoWlWYKnw94zRaHj0RwzGbwdkZFx1p9i4cihjRbbSK7D5bjt 0Kmfyj3lCvZE0seDdqVtUgtXdAUUlSJxl9nq8icOEiU3AxnFfd+gQMtCD5NOi6sUGkBE JPowmYMUm5WQEG+VVBHqo8A8eDjdpIO/Q9IzTOUOYzQFstnBoTMbOUuKFP5T6522nLuD 3SXjAqLNxBObdEBL6A8lka5HhmLWZKro1GcAmCAK83iVIV++yDwYZX1qRxAxD2pcwQwl 6T9g== X-Gm-Message-State: AJcUukeYJmVsckhoWMJoDJvxFK+HjguJj8nwpkuDXRZJptQ371zJ6zuo uHfG7Jurm3sGzRH89L0I8ExMoDZQbyo= X-Google-Smtp-Source: ALg8bN52TdLJKAHtWDdxkAPUPmJCYnhlBM7B2FX+ZC0wyKnaLC7dFHAd+P3n7cA6DElfZNqFGIIvQw== X-Received: by 2002:a17:902:1101:: with SMTP id d1mr33753942pla.136.1548159713154; Tue, 22 Jan 2019 04:21:53 -0800 (PST) Received: from localhost ([149.199.62.129]) by smtp.gmail.com with ESMTPSA id k15sm23790907pfb.147.2019.01.22.04.21.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 04:21:52 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 04:20:46 -0800 Message-Id: <20190122122048.10845-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190122122048.10845-1-edgar.iglesias@gmail.com> References: <20190122122048.10845-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::630 Subject: [Qemu-devel] [PULL v1 1/3] target/microblaze: Switch to transaction_failed hook 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell Switch the microblaze target from the old unassigned_access hook to the transaction_failed hook. The notable difference is that rather than it being called for all physical memory accesses which fail (including those made by DMA devices or by the gdbstub), it is only called for those made by the CPU via its MMU. For microblaze this makes no difference because none of the target CPU code needs to make loads or stores by physical address. Signed-off-by: Peter Maydell [EI: Add space in qemu_log()] Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.c | 2 +- target/microblaze/cpu.h | 7 ++++--- target/microblaze/op_helper.c | 22 ++++++++++++---------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 9b546a2c18..49876b19b3 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -297,7 +297,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) #ifdef CONFIG_USER_ONLY cc->handle_mmu_fault = mb_cpu_handle_mmu_fault; #else - cc->do_unassigned_access = mb_cpu_unassigned_access; + cc->do_transaction_failed = mb_cpu_transaction_failed; cc->get_phys_page_debug = mb_cpu_get_phys_page_debug; #endif dc->vmsd = &vmstate_mb_cpu; diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 3c4e0ba80a..03ca91007d 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -388,9 +388,10 @@ static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc, } #if !defined(CONFIG_USER_ONLY) -void mb_cpu_unassigned_access(CPUState *cpu, hwaddr addr, - bool is_write, bool is_exec, int is_asi, - unsigned size); +void mb_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, + unsigned size, MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr); #endif #endif diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index 7cdbbcccae..e23dcfdc20 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -486,26 +486,28 @@ void helper_mmu_write(CPUMBState *env, uint32_t ext, uint32_t rn, uint32_t v) mmu_write(env, ext, rn, v); } -void mb_cpu_unassigned_access(CPUState *cs, hwaddr addr, - bool is_write, bool is_exec, int is_asi, - unsigned size) +void mb_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, + unsigned size, MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr) { MicroBlazeCPU *cpu; CPUMBState *env; - - qemu_log_mask(CPU_LOG_INT, "Unassigned " TARGET_FMT_plx " wr=%d exe=%d\n", - addr, is_write ? 1 : 0, is_exec ? 1 : 0); - if (cs == NULL) { - return; - } + qemu_log_mask(CPU_LOG_INT, "Transaction failed: vaddr 0x%" VADDR_PRIx + " physaddr 0x" TARGET_FMT_plx " size %d access type %s\n", + addr, physaddr, size, + access_type == MMU_INST_FETCH ? "INST_FETCH" : + (access_type == MMU_DATA_LOAD ? "DATA_LOAD" : "DATA_STORE")); cpu = MICROBLAZE_CPU(cs); env = &cpu->env; + + cpu_restore_state(cs, retaddr, true); if (!(env->sregs[SR_MSR] & MSR_EE)) { return; } env->sregs[SR_EAR] = addr; - if (is_exec) { + if (access_type == MMU_INST_FETCH) { if ((env->pvr.regs[2] & PVR2_IOPB_BUS_EXC_MASK)) { env->sregs[SR_ESR] = ESR_EC_INSN_BUS; helper_raise_exception(env, EXCP_HW_EXCP); From patchwork Tue Jan 22 12:20:47 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: 10776235 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 B6DF56C2 for ; Tue, 22 Jan 2019 20:11:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1E1F2B9E4 for ; Tue, 22 Jan 2019 20:11:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94C022B9E7; Tue, 22 Jan 2019 20:11:31 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.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 413FA2B9E4 for ; Tue, 22 Jan 2019 20:11:31 +0000 (UTC) Received: from localhost ([127.0.0.1]:48707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm2OQ-0007zz-HX for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Jan 2019 15:11:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm1Pw-0005lS-RG for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:09:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm1Pv-0000xj-KV for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:09:00 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:38835) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gm1Pv-0000ZY-CS for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:08:59 -0500 Received: by mail-pl1-x62a.google.com with SMTP id e5so11927289plb.5 for ; Tue, 22 Jan 2019 11:08:28 -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 :mime-version:content-transfer-encoding; bh=9L7Po12DjNr3sbk7f27wrrPBoXaFgKuDRHnjoVF5r2Y=; b=sIszfruYkRU46qxaZSXP8BQ67XhOrxnbhHM6wPRlTM4Y+4JRNTvnYWZsYK7rn+65L1 N4qEFi+6lvgIus9MqunJSS+oejFSmH48Asdq6BRlI9yavl4AHD74qc2sFB1B4olZBU38 v1URZoZrqf5xOo7JkReeqPXclNZp9w3T9Ubn2WlIttGNb05EcmvWPLknecgl1WGNlh3C MNIQcgu0T8gjHD9FLVb81sr3X06BWqyAUCXZo71YXXNaJ5zslGonhfldG8cVfGDoXyKA SaDDsAcB17rjFUV/ZTCvQWGAnss7yN1BpCqtNb1ad83cn/5n7+pHyzI+31sjUpLpY8ru 1ewA== 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=9L7Po12DjNr3sbk7f27wrrPBoXaFgKuDRHnjoVF5r2Y=; b=qVmoySYSKJZY1oYCz3CFaXHMGzd1pDw8ahcxbLdOplulV5DYAiohj7JExNZLwCwQdd OCeT9BPr8AI2e7YmCbuCwOjk3c/T3uFsngUAtWnxHfVIgt2H3pMriwySpTo0UvhSUoOB YA6/KZ4BMLuaXnvPWj3DOQu08QMhwe7/p+Vs1xTV0vU47HZuDFuircPH9lcE16NkHOlG AA7kz6TtPtyGzPLANRgkDN/g4Ef92YPiX00Y7+64T+LXk/kE456/xLDvtZYEt3IV45IP cZFL6C94Euyjp6IDjflFXqjXAiECLGPdhx2AM4UqMLQfIXqDTWhlHshVqAYwXLXE0D5o 0KjA== X-Gm-Message-State: AJcUukc3BCZhTOtE+nZrK2PpIvXaN40ok21QrSNzP3VIlpGOZelcGnet TspnvyrVQlyj1KINIBh8K83fjtSMEak= X-Google-Smtp-Source: ALg8bN7WOUjSYmptDFWGUT4Fd74fpBv944ktEWD1iOyHfsLg1Eje29HPBp4uFIm459gSXUJvtiPbcA== X-Received: by 2002:a17:902:b093:: with SMTP id p19mr33920860plr.135.1548159747741; Tue, 22 Jan 2019 04:22:27 -0800 (PST) Received: from localhost ([149.199.62.129]) by smtp.gmail.com with ESMTPSA id g185sm18858402pfc.174.2019.01.22.04.22.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 04:22:26 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 04:20:47 -0800 Message-Id: <20190122122048.10845-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190122122048.10845-1-edgar.iglesias@gmail.com> References: <20190122122048.10845-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62a Subject: [Qemu-devel] [PULL v1 2/3] hw/microblaze: s3adsp1800: Create an unimplemented GPIO area 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org 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" Create an unimplemented GPIO area instead of leaving it unassigned. Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 5cf7b84c79..b9f0b0d06e 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -35,6 +35,7 @@ #include "sysemu/sysemu.h" #include "hw/devices.h" #include "hw/boards.h" +#include "hw/misc/unimp.h" #include "exec/address-spaces.h" #include "hw/char/xilinx_uartlite.h" @@ -47,6 +48,7 @@ #define MEMORY_BASEADDR 0x90000000 #define FLASH_BASEADDR 0xa0000000 +#define GPIO_BASEADDR 0x81400000 #define INTC_BASEADDR 0x81800000 #define TIMER_BASEADDR 0x83c00000 #define UARTLITE_BASEADDR 0x84000000 @@ -122,6 +124,8 @@ petalogix_s3adsp1800_init(MachineState *machine) sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, ETHLITE_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq[ETHLITE_IRQ]); + create_unimplemented_device("gpio", GPIO_BASEADDR, 0x10000); + microblaze_load_kernel(cpu, ddr_base, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, From patchwork Tue Jan 22 12:20:48 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: 10776203 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 14EBA13B5 for ; Tue, 22 Jan 2019 19:58:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0466729571 for ; Tue, 22 Jan 2019 19:58:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBE0A2B615; Tue, 22 Jan 2019 19:58:56 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.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 698DD29571 for ; Tue, 22 Jan 2019 19:58:56 +0000 (UTC) Received: from localhost ([127.0.0.1]:48428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm2CF-0005E5-8Q for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Jan 2019 14:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm1Re-0007Mr-4r for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:10:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm1Rc-0002TW-C4 for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:10:46 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:35671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gm1Rc-0002Ma-3e for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:10:44 -0500 Received: by mail-pf1-x42a.google.com with SMTP id z9so12235986pfi.2 for ; Tue, 22 Jan 2019 11:10:35 -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 :mime-version:content-transfer-encoding; bh=yHonHYB7qo9gGUOTexI4BOly6XkGaJVrWDBeqWrP/So=; b=Yf3WwuQ54x1zpWHvBvXdPFvCtFu9OYRt29fKsp7/vHrWMHk8lGqLDVOIFVT9KSkrGX iM299wUctRMVTHlwWDWmDtmqEp1f53z4/9GpW+8WDTKykwHRSyxBEw0u4ZJ4tL2C2P/b jcIN6td2HSvH8JjRD5YIUUk8qPV7FKHeFai2nlX9iX75Pm0FiTUJiv9BFQpYIFr/vm4E 3yZwSVy4pjXP9jiRJUHLiIUSKz2nu9lXlS8msHbwC1Ct0Zm/F13+05pGWPewG7D1hudO 6LLJXLBu9AAzs+FNbTeCGu+Jo6G/KG8dLjH0kmtdN4A7au7jtY50CD7DvV954lNAFEc0 pnhw== 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=yHonHYB7qo9gGUOTexI4BOly6XkGaJVrWDBeqWrP/So=; b=AL+Q3gX/YsXq9bV4cNnR0JsUxY+CWPRSbZV6Ho0eGxf2+5eP7ltpGIVdsndMIUpPp5 2g/n3Kfo/qFJTDp1+x2JuIpNK18XrCUJn9RtvT7TC1/Wu0XotRH5+X6AWw0QQ3lsyNPZ /zzhX2d9Br38Kbr0EPxXa3JnYtGv/NnksebjeuHZT98en+BJZfbY6em/2G0JLNfxtxrX LmLEOQtVP3V8/Obee77oBByvcHxxLQWm/46SuR7NNTEX23PU21kJmWVF4Igcxn7vTvnd EtXy9xPNQIJ8p33w4AWhDDqragevQHu//nEsU/kOAaVMI0vaL22lz+l9iGf6DDLordIY 8bnw== X-Gm-Message-State: AJcUukdd8Nl7W4rCM2WSgfmlz7dLn9s9WIxjHU/exQJyEs7tGFsUofR+ 7IctnSCZA7Yisw1oMOt6TFEWctl9iSk= X-Google-Smtp-Source: ALg8bN4VF6/7SktGTkX0RMktAGgY+ZJioGVHP/0VmVLOjIwMThHtNvQpQPcYadwJzyW9lrcqzk/C9A== X-Received: by 2002:a62:8a51:: with SMTP id y78mr33022379pfd.35.1548159782306; Tue, 22 Jan 2019 04:23:02 -0800 (PST) Received: from localhost ([149.199.62.129]) by smtp.gmail.com with ESMTPSA id 84sm22193737pfk.134.2019.01.22.04.23.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 04:23:01 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 04:20:48 -0800 Message-Id: <20190122122048.10845-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190122122048.10845-1-edgar.iglesias@gmail.com> References: <20190122122048.10845-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42a Subject: [Qemu-devel] [PULL v1 3/3] 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org 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. Reviewed-by: Luc Michel Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- 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;