diff mbox series

[Bug,204209] kernel 5.2.1: "floating point exception" in qemu with kvm enabled

Message ID bug-204209-28872-MIBnXnwk9l@https.bugzilla.kernel.org/ (mailing list archive)
State New, archived
Headers show
Series [Bug,204209] kernel 5.2.1: "floating point exception" in qemu with kvm enabled | expand

Commit Message

bugzilla-daemon@bugzilla.kernel.org July 19, 2019, 8:46 p.m. UTC
https://bugzilla.kernel.org/show_bug.cgi?id=204209

--- Comment #2 from anthony (antdev66@gmail.com) ---
I tested the patch indicated on https://lkml.org/lkml/2019/7/19/644 with simple
row position adjustments for the kernel 5.2.1 and it seems to work.
diff mbox series

Patch

--- a/arch/x86/kvm/x86.c    2019-07-19 20:17:35.358848175 +0200
+++ b/arch/x86/kvm/x86.c    2019-07-19 20:17:17.956692942 +0200
@@ -3264,6 +3264,12 @@ 

    kvm_x86_ops->vcpu_load(vcpu, cpu);

+
+   // fix floating point error kvm guest
+   if (test_thread_flag(TIF_NEED_FPU_LOAD))
+       switch_fpu_return();
+
+
    /* Apply any externally detected TSC adjustments (due to suspend) */
    if (unlikely(vcpu->arch.tsc_offset_adjustment)) {
        adjust_tsc_offset_host(vcpu, vcpu->arch.tsc_offset_adjustment);
@@ -7955,9 +7961,11 @@ 
        wait_lapic_expire(vcpu);
    guest_enter_irqoff();

-   fpregs_assert_state_consistent();
-   if (test_thread_flag(TIF_NEED_FPU_LOAD))
-       switch_fpu_return();
+// fix floating point error kvm guest
+//
+//     fpregs_assert_state_consistent();
+//     if (test_thread_flag(TIF_NEED_FPU_LOAD))
+//         switch_fpu_return();

    if (unlikely(vcpu->arch.switch_db_regs)) {
        set_debugreg(0, 7);