[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 9/9] target/loongarch: Fix cpu_reset set wrong CSR_CRMD
From: |
Song Gao |
Subject: |
[PULL 9/9] target/loongarch: Fix cpu_reset set wrong CSR_CRMD |
Date: |
Thu, 11 Jul 2024 15:48:29 +0800 |
After cpu_reset, DATF in CSR_CRMD is 0, DATM is 0.
See the manual[1] 6.4.
[1]:
https://github.com/loongson/LoongArch-Documentation/releases/download/2023.04.20/LoongArch-Vol1-v1.10-EN.pdf
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Message-Id: <20240705021839.1004374-2-gaosong@loongson.cn>
---
target/loongarch/cpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 55d468af3c..d3b5d37938 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -523,13 +523,13 @@ static void loongarch_cpu_reset_hold(Object *obj,
ResetType type)
env->fcsr0 = 0x0;
int n;
- /* Set csr registers value after reset */
+ /* Set csr registers value after reset, see the manual 6.4. */
env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, PLV, 0);
env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, IE, 0);
env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, DA, 1);
env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, PG, 0);
- env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, DATF, 1);
- env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, DATM, 1);
+ env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, DATF, 0);
+ env->CSR_CRMD = FIELD_DP64(env->CSR_CRMD, CSR_CRMD, DATM, 0);
env->CSR_EUEN = FIELD_DP64(env->CSR_EUEN, CSR_EUEN, FPE, 0);
env->CSR_EUEN = FIELD_DP64(env->CSR_EUEN, CSR_EUEN, SXE, 0);
--
2.34.1
- [PULL 0/9] loongarch-to-apply queue, Song Gao, 2024/07/11
- [PULL 7/9] target/loongarch: Remove avail_64 in trans_srai_w() and simplify it, Song Gao, 2024/07/11
- [PULL 5/9] MAINTAINERS: Add myself as a reviewer of LoongArch virt machine, Song Gao, 2024/07/11
- [PULL 4/9] hw/loongarch/virt: Remove unused assignment, Song Gao, 2024/07/11
- [PULL 9/9] target/loongarch: Fix cpu_reset set wrong CSR_CRMD,
Song Gao <=
- [PULL 1/9] hw/loongarch/boot.c: fix out-of-bound reading, Song Gao, 2024/07/11
- [PULL 3/9] hw/loongarch: Modify flash block size to 256K, Song Gao, 2024/07/11
- [PULL 2/9] hw/loongarch: Change the tpm support by default, Song Gao, 2024/07/11
- [PULL 8/9] target/loongarch: Set CSR_PRCFG1 and CSR_PRCFG2 values, Song Gao, 2024/07/11
- [PULL 6/9] target/loongarch/kvm: Add software breakpoint support, Song Gao, 2024/07/11
- Re: [PULL 0/9] loongarch-to-apply queue, Philippe Mathieu-Daudé, 2024/07/11