New: The guest will hang after live migration.
https://bugzilla.kernel.org/show_bug.cgi?id=63121
Bug ID: 63121
Summary: The guest will hang after live migration.
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: NoEnvironment:
------------
Host OS (ia32/ia32e/IA64):ia32e
Guest OS (ia32/ia32e/IA64):ia32e
Guest OS Type (Linux/Windows):Linux
kvm.git Commit:7854cbca815562a49d50bbc6f31599312853d1f4 qemu.git Commit:1cdae4573d7613149348d834c605bfbe3c7d405b Host Kernel Version:3.12.0-rc2
Bug detailed description:
--------------------------
after guest live migration, the guest will hang, and in command line some message about "KVM: entry failed, hardware error 0x80000021" will print
note:
1. after guest save/restore, the guest will hang
2. This should be a kernel bug
kvm + qemu = result 7854cbca + 1cdae457 = bad 2f303b74 + 1cdae457 = good
Reproduce steps:
----------------
1.Start a TCP daemon for migration
qemu-system-x86_64 -enable-kvm -m 2048 -smp 2 -net none /root/rhel6u4.qcow
2. create guest
qemu-system-x86_64 -enable-kvm -m 2048 -smp 2 -net none /root/rhel6u4.qcow -incoming tcp:localhost:4444
3. ctrl+alt+2 to change to qemu monitor
4. migrate tcp:localhost:4444
Current result:
----------------
guest hang, and print "KVM: entry failed, hardware error 0x80000021"
Expected result:
----------------
after live/migration or save/restore, the guest works fine
Basic root-causing log:
----------------------
after live/migration or save/restore, the command line will print:
KVM: entry failed, hardware error 0x80000021
If you're running a guest on an Intel machine without unrestricted mode support, the failure can be most likely due to the guest entering an invalid state for Intel VT. For example, the guest maybe running in big real mode which is not supported on less recent Intel processors.
EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000000
ESI=00000001 EDI=81de1228 EBP=81a01ec8 ESP=81a01ec8
EIP=8103b90b EFL=00000246 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0000 00000000 0000ffff 00009300
CS =f000 ffff0000 0000ffff 00009b00
SS =0000 00000000 0000ffff 00009300
DS =0000 00000000 0000ffff 00009300
FS =0000 00000000 0000ffff 00009300
GS =0000 00000000 0000ffff 00009300
LDT=0000 00000000 0000ffff 00008200
TR =0000 00000000 0000ffff 00008b00
GDT= 00000000 0000ffff
IDT= 00000000 0000ffff
CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
Code=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.
[Bug 63121] The guest will hang after live migration.
https://bugzilla.kernel.org/show_bug.cgi?id=63121
--- 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.
[Bug 63121] The guest will hang after live migration.
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=63121
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.
[email protected]
Reviewed-by Gleb Natapov[Bug 63121] The guest will hang after live migration.
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=63121
Zhou, Chao <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |CODE_FIX--- Comment #3 from Zhou, Chao <[email protected]> --- this commit fixed 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.
[Bug 63121] The guest will hang after live migration.
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=63121
Zhou, Chao <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED
Signature · 2 lines
You are receiving this mail because: You are watching the assignee of the bug.