From: Jiajie Chen <c@jia.je>
To: qemu-devel@nongnu.org
Cc: Jiajie Chen <c@jia.je>, Song Gao <gaosong@loongson.cn>,
Xiaojuan Yang <yangxiaojuan@loongson.cn>
Subject: [PATCH 3/3] target/loongarch: Mark CSR.PWCH as LoongArch64-only
Date: Sun, 6 Aug 2023 22:13:56 +0800 [thread overview]
Message-ID: <20230806141357.1756714-3-c@jia.je> (raw)
In-Reply-To: <20230806141357.1756714-1-c@jia.je>
LoongArch32 does not provide CSR.PWCH, thus the CSR is marked as
LoongArch64-only.
Signed-off-by: Jiajie Chen <c@jia.je>
---
target/loongarch/insn_trans/trans_privileged.c.inc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/target/loongarch/insn_trans/trans_privileged.c.inc b/target/loongarch/insn_trans/trans_privileged.c.inc
index 9c9de090f0..f00177d03d 100644
--- a/target/loongarch/insn_trans/trans_privileged.c.inc
+++ b/target/loongarch/insn_trans/trans_privileged.c.inc
@@ -56,6 +56,7 @@ enum {
CSRFL_READONLY = (1 << 0),
CSRFL_EXITTB = (1 << 1),
CSRFL_IO = (1 << 2),
+ CSRFL_LA64ONLY = (1 << 3),
};
#define CSR_OFF_FUNCS(NAME, FL, RD, WR) \
@@ -96,7 +97,7 @@ static const CSRInfo csr_info[] = {
CSR_OFF(PGDH),
CSR_OFF_FUNCS(PGD, CSRFL_READONLY, gen_helper_csrrd_pgd, NULL),
CSR_OFF(PWCL),
- CSR_OFF(PWCH),
+ CSR_OFF_FLAGS(PWCH, CSRFL_LA64ONLY),
CSR_OFF(STLBPS),
CSR_OFF(RVACFG),
CSR_OFF_FUNCS(CPUID, CSRFL_READONLY, gen_helper_csrrd_cpuid, NULL),
@@ -179,6 +180,11 @@ static bool check_csr_flags(DisasContext *ctx, const CSRInfo *csr, bool write)
if ((csr->flags & CSRFL_READONLY) && write) {
return false;
}
+#ifdef TARGET_LOONGARCH32
+ if (csr->flags & CSRFL_LA64ONLY) {
+ return false;
+ }
+#endif
if ((csr->flags & CSRFL_IO) && translator_io_start(&ctx->base)) {
ctx->base.is_jmp = DISAS_EXIT_UPDATE;
} else if ((csr->flags & CSRFL_EXITTB) && write) {
--
2.39.2
next prev parent reply other threads:[~2023-08-06 14:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-06 14:13 [PATCH 1/3] target/loongarch: Introduce loongarch32-softmmu target Jiajie Chen
2023-08-06 14:13 ` [PATCH 2/3] target/loongarch: Support LoongArch32 TLB entry Jiajie Chen
2023-08-06 14:13 ` Jiajie Chen [this message]
2023-08-06 14:41 ` [PATCH 1/3] target/loongarch: Introduce loongarch32-softmmu target Richard Henderson
2023-08-07 2:31 ` gaosong
2023-08-07 2:51 ` gaosong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230806141357.1756714-3-c@jia.je \
--to=c@jia.je \
--cc=gaosong@loongson.cn \
--cc=qemu-devel@nongnu.org \
--cc=yangxiaojuan@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).