From patchwork Thu Nov 11 01:35:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaojuan Yang X-Patchwork-Id: 12613775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E20F6C433F5 for ; Thu, 11 Nov 2021 01:46:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91EF16152A for ; Thu, 11 Nov 2021 01:46:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 91EF16152A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkzAi-0005qm-Oa for qemu-devel@archiver.kernel.org; Wed, 10 Nov 2021 20:46:36 -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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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] = { [EXCP_BREAK] = "Break", [EXCP_INE] = "Instruction Non-existent", [EXCP_FPE] = "Floating Point Exception", + [EXCP_IPE] = "Error privilege level access", + [EXCP_TLBL] = "TLB load", + [EXCP_TLBS] = "TLB store", + [EXCP_INST_NOTAVAIL] = "TLB inst not exist", + [EXCP_TLBM] = "TLB modify", + [EXCP_TLBPE] = "TLB priviledged error", + [EXCP_TLBNX] = "TLB execute-inhibit", + [EXCP_TLBNR] = "TLB read-inhibit", + [EXCP_EXT_INTERRUPT] = "Interrupt", + [EXCP_DBP] = "Debug breakpoint", + [EXCP_IBE] = "Instruction bus error", + [EXCP_DBE] = "Data bus error", + [EXCP_DINT] = "Debug interrupt", }; 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 = 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 = EXCP_DINT, }; #define LOONGARCH_CPU_TYPE_SUFFIX "-" TYPE_LOONGARCH_CPU