From nobody Tue Feb 10 02:00:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636595201387232.98131885888188; Wed, 10 Nov 2021 17:46:41 -0800 (PST) Received: from localhost ([::1]:52046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkzAm-0005qm-Bj for importer@patchew.org; Wed, 10 Nov 2021 20:46:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkz0A-0005Y2-A6 for qemu-devel@nongnu.org; Wed, 10 Nov 2021 20:35:42 -0500 Received: from mail.loongson.cn ([114.242.206.163]:53924 helo=loongson.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkz08-0001gM-9l for qemu-devel@nongnu.org; Wed, 10 Nov 2021 20:35:42 -0500 Received: from kvm-dev1.localdomain (unknown [10.2.5.134]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxr9Ngc4xh9RMCAA--.4955S6; Thu, 11 Nov 2021 09:35:37 +0800 (CST) From: Xiaojuan Yang To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 04/30] target/loongarch: Define exceptions for LoongArch. Date: Thu, 11 Nov 2021 09:35:02 +0800 Message-Id: <1636594528-8175-5-git-send-email-yangxiaojuan@loongson.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1636594528-8175-1-git-send-email-yangxiaojuan@loongson.cn> References: <1636594528-8175-1-git-send-email-yangxiaojuan@loongson.cn> X-CM-TRANSID: AQAAf9Dxr9Ngc4xh9RMCAA--.4955S6 X-Coremail-Antispam: 1UD129KBjvJXoW7AFWxZw15Jry8tFW5ZFWxtFb_yoW8Aw1xpr nrZr13tw4jqa9Iywn5Zr10qFnxXr18Gr47uan3Jry7ursIqryIqF1ktasxtFn8Way5AF1I vr1rAr1xuF48WwUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: p1dqw5xldry3tdq6z05rqj20fqof0/ 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=114.242.206.163; envelope-from=yangxiaojuan@loongson.cn; helo=loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: , Cc: Song Gao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1636595203437100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch introduces all possible exceptions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 13 +++++++++++++ target/loongarch/cpu.h | 17 +++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index a53c8ebfb5..16443159cc 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -37,6 +37,19 @@ static const char * const excp_names[EXCP_LAST + 1] =3D { [EXCP_BREAK] =3D "Break", [EXCP_INE] =3D "Instruction Non-existent", [EXCP_FPE] =3D "Floating Point Exception", + [EXCP_IPE] =3D "Error privilege level access", + [EXCP_TLBL] =3D "TLB load", + [EXCP_TLBS] =3D "TLB store", + [EXCP_INST_NOTAVAIL] =3D "TLB inst not exist", + [EXCP_TLBM] =3D "TLB modify", + [EXCP_TLBPE] =3D "TLB priviledged error", + [EXCP_TLBNX] =3D "TLB execute-inhibit", + [EXCP_TLBNR] =3D "TLB read-inhibit", + [EXCP_EXT_INTERRUPT] =3D "Interrupt", + [EXCP_DBP] =3D "Debug breakpoint", + [EXCP_IBE] =3D "Instruction bus error", + [EXCP_DBE] =3D "Data bus error", + [EXCP_DINT] =3D "Debug interrupt", }; =20 const char *loongarch_exception_name(int32_t exception) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index 10fcd53104..399c4cb5e8 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -369,8 +369,21 @@ enum { EXCP_BREAK, EXCP_INE, EXCP_FPE, - - EXCP_LAST =3D EXCP_FPE, + EXCP_IPE, + EXCP_TLBL, + EXCP_TLBS, + EXCP_INST_NOTAVAIL, + EXCP_TLBM, + EXCP_TLBPE, + EXCP_TLBNX, + EXCP_TLBNR, + EXCP_EXT_INTERRUPT, + EXCP_DBP, + EXCP_IBE, + EXCP_DBE, + EXCP_DINT, + + EXCP_LAST =3D EXCP_DINT, }; =20 #define LOONGARCH_CPU_TYPE_SUFFIX "-" TYPE_LOONGARCH_CPU --=20 2.27.0