From patchwork Mon Aug 20 02:31:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10569835 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 ADD13920 for ; Mon, 20 Aug 2018 02:32:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 940B229197 for ; Mon, 20 Aug 2018 02:32:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87F8C2919E; Mon, 20 Aug 2018 02:32:17 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F3D5D29197 for ; Mon, 20 Aug 2018 02:32:16 +0000 (UTC) Received: from localhost ([::1]:44761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frZzL-0003My-Rr for patchwork-qemu-devel@patchwork.kernel.org; Sun, 19 Aug 2018 22:32:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frZyZ-000327-9F for qemu-devel@nongnu.org; Sun, 19 Aug 2018 22:31:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frZyY-0002vn-IS for qemu-devel@nongnu.org; Sun, 19 Aug 2018 22:31:27 -0400 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:42241) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1frZyY-0002vR-Aw for qemu-devel@nongnu.org; Sun, 19 Aug 2018 22:31:26 -0400 Received: by mail-lj1-x241.google.com with SMTP id f1-v6so10341737ljc.9 for ; Sun, 19 Aug 2018 19:31:26 -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; bh=+N4sXfU5w38F06Q60ylEAD3/cGnVSUUeZ8HEuW6bv9o=; b=L6b+iIa9Tnc2lQ1QimMpRCt20f+4/u7R08m++Vxk+YHhNSvMJxwL6jxOBJvTLEwFGj nrhf4/h6j45bCRwvS0QsvNbHPS8AY7RiIgfhfJBzn35MCGuyflD8YN0Xn1Jo3PKUcl3T XRlR0T2cKFu8eTHMJI0UKN/oErAjjoGpKJAtigKU//O8uvg9F9KI850rlGUhiXm8fCk9 HCxHl6NhqeY2yntTyA6qMDuRJod+TAxPt3lEDqfO/WUIjoQKcarDGewRBtSWhlqG6+48 p/R7axoWo8bcO/dtEo+Bi2+bbsjswMxbuvyt7bwGqG1OHfodVFP2Cq+Hnmo49qosR9W5 wiMw== 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; bh=+N4sXfU5w38F06Q60ylEAD3/cGnVSUUeZ8HEuW6bv9o=; b=ug9ZzeJdxxMHl7eHQsRlXequEHWKF+eaYckLVgZfE1GQM0zXws9fZ1JiHawELo2sAc j2FdlXoRBQzWoGuSimddGQs8If0DMwapGi5zAv+mDHrBwXSL0Ji0OrRBIKggaabnf6KU ez4lIZ8EDvLnxjtssAhL13LsTCxRRynX0YwJLk2k8qRBtyOX6jvHE7yTVi41Lu/6Hooy QaKTgPIJv5jotqrpetqX3gCkFeS4L+Wb7Q0ZzqjnShx8+rcGva4JWNhvORbl1I4xY/Bu F6V7vg+CwXulWr63S4DekJyw54vo8K5gC0fgV6mArHzwOUo/e4FWMSB8vXVFN9rejdw1 Iczg== X-Gm-Message-State: AOUpUlFgM/pZxXjeM1RiuZ7lPOJmcKQGDHXKbZ7eVD3G0uzf6s8pX4In EYjh8YJ3aCYSsh9kp4QWZz/HHor+Ec8= X-Google-Smtp-Source: AA+uWPzuxVLjd2PD5BUL1zxmUHkPgXwY5EE0l2WEopYemMSU6Fknwuuizyz9mDZNjcKv1gJwmuUHQw== X-Received: by 2002:a2e:8514:: with SMTP id j20-v6mr5993933lji.10.1534732284465; Sun, 19 Aug 2018 19:31:24 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net. (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id q128-v6sm1395493ljq.72.2018.08.19.19.31.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 19:31:23 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Sun, 19 Aug 2018 19:31:10 -0700 Message-Id: <20180820023110.6583-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::241 Subject: [Qemu-devel] [PATCH] target/xtensa: convert to do_transaction_failed 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: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Max Filippov --- target/xtensa/cpu.c | 2 +- target/xtensa/cpu.h | 7 ++++--- target/xtensa/op_helper.c | 12 +++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 590813d4f7b9..a54dbe42602d 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -186,7 +186,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) #else cc->do_unaligned_access = xtensa_cpu_do_unaligned_access; cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; - cc->do_unassigned_access = xtensa_cpu_do_unassigned_access; + cc->do_transaction_failed = xtensa_cpu_do_transaction_failed; #endif cc->debug_excp_handler = xtensa_breakpoint_handler; cc->disas_set_info = xtensa_cpu_disas_set_info; diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 7472cf3ca32a..1362772617ea 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -497,9 +497,10 @@ int xtensa_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw, int size, int mmu_idx); void xtensa_cpu_do_interrupt(CPUState *cpu); bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request); -void xtensa_cpu_do_unassigned_access(CPUState *cpu, hwaddr addr, - bool is_write, bool is_exec, int opaque, - unsigned size); +void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, + unsigned size, MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr); void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, int flags); hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c index d4c942d87980..06fe346f02ff 100644 --- a/target/xtensa/op_helper.c +++ b/target/xtensa/op_helper.c @@ -78,18 +78,20 @@ void tlb_fill(CPUState *cs, target_ulong vaddr, int size, } } -void xtensa_cpu_do_unassigned_access(CPUState *cs, hwaddr addr, - bool is_write, bool is_exec, int opaque, - unsigned size) +void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, + unsigned size, MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr) { XtensaCPU *cpu = XTENSA_CPU(cs); CPUXtensaState *env = &cpu->env; + cpu_restore_state(cs, retaddr, true); HELPER(exception_cause_vaddr)(env, env->pc, - is_exec ? + access_type == MMU_INST_FETCH ? INSTR_PIF_ADDR_ERROR_CAUSE : LOAD_STORE_PIF_ADDR_ERROR_CAUSE, - is_exec ? addr : cs->mem_io_vaddr); + addr); } static void tb_invalidate_virtual_addr(CPUXtensaState *env, uint32_t vaddr)