[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] target/riscv: enable floating point unit
From: |
Peter Maydell |
Subject: |
Re: [PATCH 1/1] target/riscv: enable floating point unit |
Date: |
Wed, 18 Sep 2024 14:12:48 +0100 |
On Wed, 18 Sept 2024 at 14:06, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
> Thanks Peter for looking into this.
>
> QEMU's cpu_synchronize_all_post_init() and
> do_kvm_cpu_synchronize_post_reset() both end up in
> kvm_arch_put_registers() and that is long after Linux
> kvm_arch_vcpu_create() has been setting some FPU state. See the output
> below.
>
> kvm_arch_put_registers() copies the CSRs by calling
> kvm_riscv_put_regs_csr(). Here we can find:
>
> KVM_RISCV_SET_CSR(cs, env, sstatus, env->mstatus);
>
> This call enables or disables the FPU according to the value of
> env->mstatus.
>
> So we need to set the desired state of the floating point unit in QEMU.
> And this is what the current patch does both for TCG and KVM.
If it does this for both TCG and KVM then I don't understand
this bit from the commit message:
# Without this patch EDK II with TLS enabled crashes when hitting the first
# floating point instruction while running QEMU with --accel kvm and runs
# fine with --accel tcg.
Shouldn't this guest crash the same way with both KVM and TCG without
this patch, because the FPU state is the same for both?
-- PMM
- [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/16
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Andrew Jones, 2024/09/17
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/17
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Andrew Jones, 2024/09/17
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/17
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Andrew Jones, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Peter Maydell, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit,
Peter Maydell <=
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Andrew Jones, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Peter Maydell, 2024/09/18
- Re: [PATCH 1/1] target/riscv: enable floating point unit, Heinrich Schuchardt, 2024/09/18