Re: Floating point instructions (e.g. cvtsi2sd) incorrect result

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

 



On 2016/8/5 4:40, Alexandru Duţu wrote:
Hi everyone,

I am using KVM to run a virtual machine (x86) without having a guest
OS. So the machine state is set for long mode before calling KVM_RUN
and I am trapping out of KVM on every syscall  to emulate the syscall
in the program that uses KVM. Also I am trapping out of KVM on
pagefaults to deal with stack growth.

This has been working great for integer workloads, however I have
encoutered some workloads which are using floating point instructions,
for example cvtsi2sd to cast an integer to a double, and their result
is incorrect.

Recently I have discovered that KVM does FPU context save on-demand,
meaning when the virtual machine actually uses the FPU [1]. I am

Latest KVM will use eagerfpu if host is using eagerfpu.

wondering if this machanism has some baked in assumptions about
running a virtual machine with a guest OS and if a guest OS is not
present the FPU state might be altered? Also I have not seen any #NM
exceptions, these usually trap out of KVM.

#NM exceptions will trap into KVM only when current hardware FPU state not belongs to the running VCPU, i.e. first access to FPU.


The FPU state that I am using [2] seems valid and it does not change
when trapping out of KVM for syscalls and pagefaults. In addition, I

Have you check the state before vm entry?

have tried running with multiple linux versions 2.6.29, 3.13 and 4.0.4
and all of them give incorrect floating point instructions result,
however for different instructions.

Thank you,



--
Yang
Alibaba Cloud Computing
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux