qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 25/43] target/loongarch: Add LoongArch CSR instruction


From: yangxiaojuan
Subject: Re: [PATCH v3 25/43] target/loongarch: Add LoongArch CSR instruction
Date: Thu, 5 May 2022 15:22:56 +0800
User-agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

Hi Richard,

On 2022/5/1 上午1:22, Richard Henderson wrote:
On 4/29/22 03:07, Xiaojuan Yang wrote:
+    [LOONGARCH_CSR_CPUID] = {
+        .offset = -1,
+        .flags = CSRFL_READONLY,
+        .readfn = gen_helper_csrrd_cpuid,
+        .writefn = NULL
+    },

The offset should be

    (int)offsetof(CPUState, cpu_index) - (int)offsetof(LoongArchCPU, env)

at which point you don't need the readfn.

+target_ulong helper_csrrd_tval(CPULoongArchState *env)
+{
+    LoongArchCPU *cpu = LOONGARCH_CPU(env_cpu(env));

cpu = env_archcpu(env).

Several other instances in the file.

Otherwise it looks good.


r~ \
Sorry for the late reply,    I will correct it on v4,

Thanks.
Xiaojuan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]