summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiaojuan Yang2022-07-15 08:48:29 +0200
committerRichard Henderson2022-07-19 18:23:58 +0200
commitfa90456f78b5f49515bbf6393fa10a1d70a5bf86 (patch)
treebedefeae96729f1ef2dda0897f5035f49c8188f5
parenttarget/loongarch/op_helper: Fix coverity cond_at_most error (diff)
downloadqemu-fa90456f78b5f49515bbf6393fa10a1d70a5bf86.tar.gz
qemu-fa90456f78b5f49515bbf6393fa10a1d70a5bf86.tar.xz
qemu-fa90456f78b5f49515bbf6393fa10a1d70a5bf86.zip
target/loongarch/cpu: Fix cpucfg default value
We should config cpucfg[20] to set value for the scache's ways, sets, and size arguments when loongarch cpu init. However, the old code wirte 'sets argument' twice, so we change one of them to 'size argument'. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220715064829.1521482-1-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/loongarch/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 0d49ce68e4..1415793d6f 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -406,7 +406,7 @@ static void loongarch_la464_initfn(Object *obj)
data = 0;
data = FIELD_DP32(data, CPUCFG20, L3IU_WAYS, 15);
data = FIELD_DP32(data, CPUCFG20, L3IU_SETS, 14);
- data = FIELD_DP32(data, CPUCFG20, L3IU_SETS, 6);
+ data = FIELD_DP32(data, CPUCFG20, L3IU_SIZE, 6);
env->cpucfg[20] = data;
env->CSR_ASID = FIELD_DP64(0, CSR_ASID, ASIDBITS, 0xa);