KVM Archive on lore.kernel.org
 help / color / Atom feed
* [Bug 204209] New: kernel 5.2.1: "floating point exception" in qemu with kvm enabled
@ 2019-07-17 14:27 bugzilla-daemon
  2019-07-18 12:28 ` [Bug 204209] " bugzilla-daemon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bugzilla-daemon @ 2019-07-17 14:27 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=204209

            Bug ID: 204209
           Summary: kernel 5.2.1: "floating point exception" in qemu with
                    kvm enabled
           Product: Virtualization
           Version: unspecified
    Kernel Version: 5.2.1
          Hardware: x86-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: kvm
          Assignee: virtualization_kvm@kernel-bugs.osdl.org
          Reporter: antdev66@gmail.com
        Regression: No

After updating the kernel from 5.1.17 to 5.2.1, when I use the g++ compiler in
qemu with kvm enabled, often the compiler launched in the guest for compile my
sources ends with this error: "exception in floating point".

Moreever it is not possible to update the bsd system because the process (that
use g++ compiler) exits with the same error.

Same thing for some system utilities, like "pkg update".

But if I boot the system with the previous 5.1.17 kernel and launch qemu, as
indicated above, everything works fine and I don't detect errors.

Command line is:

/usr/bin/qemu-system-x86_64 -k it -machine accel=kvm -m 4096 -no-fd-bootchk
-show-cursor -drive file="vmdragon.img",if=ide,media=disk -boot once=c,menu=off
-net none -rtc base=localtime -name "vmdragon" -smp 8 -vga std -device
qemu-xhci,id=xhci

I can't test without kvm because the process is very slow, but I think the
problem could be in some changes made to the kvm module.

Thanks,
Antonio

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 204209] kernel 5.2.1: "floating point exception" in qemu with kvm enabled
  2019-07-17 14:27 [Bug 204209] New: kernel 5.2.1: "floating point exception" in qemu with kvm enabled bugzilla-daemon
@ 2019-07-18 12:28 ` " bugzilla-daemon
  2019-07-19 20:46 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2019-07-18 12:28 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=204209

Thomas Lambertz (mail@thomaslambertz.de) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mail@thomaslambertz.de

--- Comment #1 from Thomas Lambertz (mail@thomaslambertz.de) ---
I can confirm this issue. It occurs since 5.2, when the FPU state changes were
introduced. I send an e-mail about this yesterday, seems I should have included
the kvm mailing list:

https://lkml.org/lkml/2019/7/17/758


- Thomas

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 204209] kernel 5.2.1: "floating point exception" in qemu with kvm enabled
  2019-07-17 14:27 [Bug 204209] New: kernel 5.2.1: "floating point exception" in qemu with kvm enabled bugzilla-daemon
  2019-07-18 12:28 ` [Bug 204209] " bugzilla-daemon
@ 2019-07-19 20:46 ` bugzilla-daemon
  2019-07-28 12:03 ` bugzilla-daemon
  2019-07-31 11:15 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2019-07-19 20:46 UTC (permalink / raw)
  To: kvm

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.


--- 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);

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 204209] kernel 5.2.1: "floating point exception" in qemu with kvm enabled
  2019-07-17 14:27 [Bug 204209] New: kernel 5.2.1: "floating point exception" in qemu with kvm enabled bugzilla-daemon
  2019-07-18 12:28 ` [Bug 204209] " bugzilla-daemon
  2019-07-19 20:46 ` bugzilla-daemon
@ 2019-07-28 12:03 ` bugzilla-daemon
  2019-07-31 11:15 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2019-07-28 12:03 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=204209

--- Comment #3 from anthony (antdev66@gmail.com) ---
Today I saw the following commit:

>Revert "kvm: x86: Use task structs fpu field for user"
>commit ec269475cba7bcdd1eb8fdf8e87f4c6c81a376fe upstream.
>
>This reverts commit 240c35a3783ab9b3a0afaba0dde7291295680a6b
>("kvm: x86: Use task structs fpu field for user", 2018-11-06).
>The commit is broken and causes QEMU's FPU state to be destroyed
>when KVM_RUN is preempted.
>
>Fixes: 240c35a3783a ("kvm: x86: Use task structs fpu field for user")

applied to the 5.2.4 kernel and I thought it could relate to the reported bug,
but recompiling the kernel without previous indicated patch, the guest report
"fpu exception" error again: it was necessary to re-include the patch and
recompile the kernel for it to work.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 204209] kernel 5.2.1: "floating point exception" in qemu with kvm enabled
  2019-07-17 14:27 [Bug 204209] New: kernel 5.2.1: "floating point exception" in qemu with kvm enabled bugzilla-daemon
                   ` (2 preceding siblings ...)
  2019-07-28 12:03 ` bugzilla-daemon
@ 2019-07-31 11:15 ` bugzilla-daemon
  3 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2019-07-31 11:15 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=204209

anthony (antdev66@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |CODE_FIX

--- Comment #4 from anthony (antdev66@gmail.com) ---
Tested with Kernel 5.2.5: problem solved.

Thanks,
Antonio

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 14:27 [Bug 204209] New: kernel 5.2.1: "floating point exception" in qemu with kvm enabled bugzilla-daemon
2019-07-18 12:28 ` [Bug 204209] " bugzilla-daemon
2019-07-19 20:46 ` bugzilla-daemon
2019-07-28 12:03 ` bugzilla-daemon
2019-07-31 11:15 ` bugzilla-daemon

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox