From nobody Tue Nov 26 14:48:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1707330178; cv=none; d=zohomail.com; s=zohoarc; b=neTyWQCS17XX4as09v5L3SRhWqjiT+HIOfz99KO8UHZ+AiXQkkR5riC+eufI9+jRsFemzKlki3sG7kjuqRIZZZqKGd94A5cVuTi11jFexMQ7T85Xyj55uP5InGNKHiqFRvyTC/k9G1bcD+vv/qHw7xGQrw7kDJmoNIYsGgLjMBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707330178; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dLVcAUuRDqL88X25lYvkxp7Z6s2Mu3mKuPZHkAvrT/c=; b=DgXM9vQwIqNAm78kfsbmIHVqGYVVhb6ydwlifzxGPwOLbFqs3IPexPHsO90vCMqUMPM95zLldUYTawqTCM0BLb6c8XyryDs2oIzrdZF7rJWOXCBAu7WhNk0x/Bp7tUNBhuuSsV0JOBi/j1RBSSAHNokITuY5Jpgl9QJob7Z+eas= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707330178077918.778430853453; Wed, 7 Feb 2024 10:22:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXmXK-0004kR-Ft; Wed, 07 Feb 2024 13:20:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXmXH-0004hy-3S for qemu-devel@nongnu.org; Wed, 07 Feb 2024 13:20:39 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXmXF-00087u-Fp for qemu-devel@nongnu.org; Wed, 07 Feb 2024 13:20:38 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5616B619D7; Wed, 7 Feb 2024 18:20:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3419EC43390; Wed, 7 Feb 2024 18:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707330036; bh=98mbO8TIJY8H/aHyk2tyxWud+0ypEkYGWnHIB/+v55o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J33HycEiFoJvFiphlurxfoPMYFzYlTto+n2J+NkvCYNXlK8CYfvryhXfqxuNRVBSy zJgcpeUJQmtLQR1pxVE2jkzplqPa6SaVDB0ypZTebP9w21ko+kUVvlBWqNH/K8vyTY sDusbKOLLHYLWqisAmSgiA/zJFSFDh7dwF7byJ1ZPQz6GVeGiVhsuHtjE70FgH9l4Q KWFoxGM9+zkgKSpSZ2YCaxXc6TbOZg8PdxBWHqE1pdf5tNAZeKIE/IKQd53VaPba9z ofArXS0Tq5r9fJjV/lIavEVCd70Hhp5yjWh08NwYLOhg7lNLEu9NyTu5uoRka0XsOH H0e95FmarA3nw== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Richard Henderson , Helge Deller Subject: [PATCH 07/13] target/hppa: Implement do_transaction_failed handler for I/O errors Date: Wed, 7 Feb 2024 19:20:17 +0100 Message-ID: <20240207182023.36316-8-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240207182023.36316-1-deller@kernel.org> References: <20240207182023.36316-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=139.178.84.217; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -71 X-Spam_score: -7.2 X-Spam_bar: ------- X-Spam_report: (-7.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.106, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1707330179001100002 Content-Type: text/plain; charset="utf-8" From: Helge Deller Add the do_transaction_failed() handler to tigger a HPMC to the CPU in case of I/O transaction errors. This is a preparation commit. We still lack implementation for some registers, so do not yet enable sendi= ng HPMCs. Having this hunk here now nevertheless helps for the further development, so that it can easily be enabled later on. Signed-off-by: Helge Deller --- target/hppa/cpu.c | 1 + target/hppa/cpu.h | 5 +++++ target/hppa/mem_helper.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 5f87c1b12a..afe73d4474 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -191,6 +191,7 @@ static const TCGCPUOps hppa_tcg_ops =3D { .cpu_exec_interrupt =3D hppa_cpu_exec_interrupt, .do_interrupt =3D hppa_cpu_do_interrupt, .do_unaligned_access =3D hppa_cpu_do_unaligned_access, + .do_transaction_failed =3D hppa_cpu_do_transaction_failed, #endif /* !CONFIG_USER_ONLY */ }; =20 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 06b65f2258..5a4b56c975 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -383,6 +383,11 @@ bool hppa_cpu_exec_interrupt(CPUState *cpu, int int_re= q); int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, int type, hwaddr *pphys, int *pprot, HPPATLBEntry **tlb_entry); +void hppa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retad= dr); extern const MemoryRegionOps hppa_io_eir_ops; extern const VMStateDescription vmstate_hppa_cpu; void hppa_cpu_alarm_timer(void *); diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 629a9d90ef..676c0b3003 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -353,6 +353,25 @@ raise_exception_with_ior(CPUHPPAState *env, int excp, = uintptr_t retaddr, cpu_loop_exit_restore(cs, retaddr); } =20 +void hppa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retad= dr) +{ + CPUHPPAState *env =3D cpu_env(cs); + + qemu_log_mask(LOG_GUEST_ERROR, "HPMC at " TARGET_FMT_lx ":" TARGET_FMT= _lx + " while accessing I/O at %#08" HWADDR_PRIx "\n", + env->iasq_f, env->iaoq_f, physaddr); + + /* FIXME: Enable HPMC exceptions when firmware has clean device probin= g */ + if (0) { + raise_exception_with_ior(env, EXCP_HPMC, retaddr, addr, + MMU_IDX_MMU_DISABLED(mmu_idx)); + } +} + bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, MMUAccessType type, int mmu_idx, bool probe, uintptr_t retaddr) --=20 2.43.0