qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 1/3] target/riscv: Fix tb->flags FS status


From: ShihPo Hung
Subject: Re: [PATCH v3 1/3] target/riscv: Fix tb->flags FS status
Date: Wed, 15 Jan 2020 22:27:39 +0800



On Wed, Jan 15, 2020 at 2:29 PM Alistair Francis <address@hidden> wrote:
> -    *flags = cpu_mmu_index(env, 0);
> -    if (riscv_cpu_fp_enabled(env)) {
> -        *flags |= TB_FLAGS_MSTATUS_FS;
> -    }
> +    *flags = cpu_mmu_index(env, 0) | (env->mstatus & MSTATUS_FS);

I don't think this is right, you should use the riscv_cpu_fp_enabled() function.

Right now it's the same as env->mstatus & MSTATUS_FS but when the
Hypervisor extension goes in riscv_cpu_fp_enabled() will be more
complex.

Alistair

I agree using riscv_cpu_fp_enabled() to hide the complexity when checking FP,
but here I only duplicate the FP status (disabled/initial/clean/dirty) to tb->flags
no matter FP is enabled or not.

Is it still necessary to check this before duplicating it?

I think it is not as long as TB_FLAGS_MSTATUS_FS is equivalent to MSTATUS_FS.
But I don't know what changes hypervisor extension brings, please correct me if I am wrong.

ShihPo


reply via email to

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