Skip to contentSkip to conversation

New: guest hang when reboot .

Bug 63131 [email protected] 1 participant 5 messages Oct 16, 2013 – Nov 4, 2013 KVM

lore
Share & tools
lore
#0 lore raw

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

            Bug ID: 63131
           Summary: guest hang when reboot .
           Product: Virtualization
           Version: unspecified
    Kernel Version: 3.12.0-rc2
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: kvm
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

Environment:
------------
Host OS (ia32/ia32e/IA64):ia32e
Guest OS (ia32/ia32e/IA64):ia32e
Guest OS Type (Linux/Windows):Windows
kvm.git Commit:7854cbca815562a49d50bbc6f31599312853d1f4 qemu.git Commit:1cdae4573d7613149348d834c605bfbe3c7d405b Host Kernel Version:3.12.0-rc2
Hardware: Romley_EP

Bug detailed description:
--------------------------
create guest then reboot ,the guest will hang

note
1.try win7, win8, win2012,win2k8 and rhel6u4 guest, while reboot,guest will hang
2.when create guest with "-cpu host" the guest reboot pass 3.This should be a kernel bug

kvm      + qemu     =  result
7854cbca + 1cdae457 =  bad
2f303b74 + 1cdae457 =  good

Reproduce steps:
----------------
1.create guest
qemu-system-x86_64 -enable-kvm -m 2048 -smp 2 -net none win7.qcow

2.reboot the guest

Current result:
----------------
guest hang

Expected result:
----------------
guest can work well while reboot

Basic root-causing log:

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 63131] guest hang when reboot .

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

--- Comment #1 from Zhou, Chao <[email protected]> --- the first bad commit is
commit d7876f1be40a16223a44355740de625849504eb5

Author: Paolo Bonzini <[email protected]>
Date:   Wed Oct 2 16:06:15 2013 +0200

KVM: x86: prevent setting unsupported XSAVE states

A guest can still attempt to save and restore XSAVE states even if they have been masked in CPUID leaf 0Dh. This usually is not visible to the guest, but is still wrong: "Any attempt to set a reserved bit (as determined by the contents of EAX and EDX after executing CPUID with EAX=0DH, ECX= 0H) in XCR0 for a given processor will result in a #GP exception".

The patch also performs the same checks as __kvm_set_xcr in KVM_SET_XSAVE. This catches migration from newer to older kernel/processor before the guest starts running.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 63131] guest hang when reboot .

In reply to [email protected]

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

Paolo Bonzini <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Paolo Bonzini <[email protected]> --- Reproduced on Ivy Bridge host with "-cpu Westmere", passes with "-cpu SandyBridge".

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
author Reviewed-by Gleb Natapov
#3 lore raw

[Bug 63131] guest hang when reboot .

In reply to [email protected]

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

Zhou, Chao <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |CODE_FIX

--- Comment #3 from Zhou, Chao <[email protected]> --- this commit fix the bug:
commit 46c34cb059d519601fb567b55cf45c300fea2928

Author: Paolo Bonzini <[email protected]>
Date:   Thu Oct 17 16:50:46 2013 +0200

KVM: x86: fix KVM_SET_XCRS for CPUs that do not support XSAVE

The KVM_SET_XCRS ioctl must accept anything that KVM_GET_XCRS could return. XCR0's bit 0 is always 1 in real processors with XSAVE, and KVM_GET_XCRS will always leave bit 0 set even if the emulated processor does not have XSAVE. So, KVM_SET_XCRS must ignore that bit when checking for attempts to enable unsupported save states.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.