Bug 50921
Summary: | kvm hangs booting Windows 2000 | ||
---|---|---|---|
Product: | Virtualization | Reporter: | Lucio Crusca (lucio) |
Component: | kvm | Assignee: | virtualization_kvm |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | alan, florian, gleb |
Priority: | P1 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 3.6.x | Subsystem: | |
Regression: | Yes | Bisected commit-id: | |
Attachments: |
kernel config
patch to implement aad (D5) instruction. |
Description
Lucio Crusca
2012-11-24 08:07:03 UTC
Trace it please while it hang http://www.linux-kvm.org/page/Tracing. Also try running without vbox modules. Can I have your image somehow? And if you have time it would be very helpful to bisect it. What should I do in order to "bisect" it? Here the first tests results: vbox modules do not make a difference (tried rmmod vboxpci vboxnetadp vboxnetflt vboxdrv and then kvm ...). The trace.dat is about 60M, I could upload it somewhere, however I tried looking at it and I'm reasonably sure it hangs here: $ trace-cmd report | grep 125\\.332 | tail kvm-6588 [000] 125.332264: kvm_entry: vcpu 0 kvm-6588 [000] 125.332264: kvm_emulate_insn: 10000:44f8: 75 27 kvm-6588 [000] 125.332265: kvm_entry: vcpu 0 kvm-6588 [000] 125.332266: kvm_emulate_insn: 10000:44fa: 8b 3c kvm-6588 [000] 125.332267: kvm_entry: vcpu 0 kvm-6588 [000] 125.332267: kvm_emulate_insn: 10000:44fc: 46 kvm-6588 [000] 125.332268: kvm_entry: vcpu 0 kvm-6588 [000] 125.332269: kvm_emulate_insn: 10000:44fd: 46 kvm-6588 [000] 125.332269: kvm_entry: vcpu 0 kvm-6588 [000] 125.332270: kvm_emulate_insn: 10000:44fe: 8b 14 $ trace-cmd report | grep 125\\.333 | head kvm-6588 [000] 125.333950: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333951: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333951: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333952: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333953: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333953: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333954: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333954: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333955: kvm_emulate_insn: 10000:4782: d5 kvm-6588 [000] 125.333955: kvm_emulate_insn: 10000:4782: d5 The rest of the log is about 5 seconds of d5 d5 d5 d5... As for the bisect, I'm not sure of a good commit in the vanilla tree. By now the only working kernel I have is a debian one. While doing these test a suspect came to my mind: a difference between mine and debian kernels is that I configure mine preemptible low latency desktop. Could that be the cause? Try 3.5.0 kernel, it should work. Preemptible low latency desktop config should not matter. I'll find the place to put the trace.dat file and let you know. I'm now compiling 3.5.0. About the guest image, it's a 2.1GB qcow2 file. No hope to upload it anywhere with my internet connection. The only way I see to let you have a copy is burning a dvd and mailing it to you. If you are interested please hand me your paper mail address. Tried 3.5.0: as soon as the guest window shows up (before SeaBIOS messages) it closes and kvm segfaults... Now I'm quite sure kvm works at least for someone (many) in 3.5.0. That leads me to believe all this is specific to my computer or my kernel configuration. Could the problem be caused by the target CPU? My vanilla kernels are 32bit configured for Core 2/newer Xeon. Hmm, this is something different. Which version of qemu and can you get a stack trace? 32bit host kernels are tested less than 64bit, but your original problem with wind2000 does not look to be 32bit related. Looks like instruction emulation problem. vboxpci 22709 0 - Live 0xf89bb000 (O) vboxnetadp 25431 0 - Live 0xf8aa6000 (O) vboxnetflt 22987 0 - Live 0xf8aae000 (O) vboxdrv 227471 3 vboxpci,vboxnetadp,vboxnetflt, Live 0xf91d4000 (O) Shouldn't be interefering but probably a good idea to test without @Alan: see comment #5, since then I've always tested with and without vbox modules. @Gleb: can't run on 3.5.0 right now, I'll take the stack trace ASAP. Reply-To: xiaoguangrong@linux.vnet.ibm.com On 11/24/2012 09:44 PM, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=50921 > > > > > > --- Comment #5 from Lucio Crusca <lucio@sulweb.org> 2012-11-24 13:44:16 --- > Here the first tests results: > > vbox modules do not make a difference (tried rmmod vboxpci vboxnetadp > vboxnetflt vboxdrv and then kvm ...). > > The trace.dat is about 60M, I could upload it somewhere, however I tried > looking at it and I'm reasonably sure it hangs here: > > $ trace-cmd report | grep 125\\.332 | tail > kvm-6588 [000] 125.332264: kvm_entry: vcpu 0 > kvm-6588 [000] 125.332264: kvm_emulate_insn: 10000:44f8: > 75 > 27 Hmm... no 'kvm_exit' message. It looks like the infinite loop is caused by: | /* Don't enter VMX if guest state is invalid, let the exit handler | start emulation until we arrive back to a valid state */ | if (vmx->emulation_required && emulate_invalid_guest_state) | return; (vmx_vcpu_run in arch/x86/kvm/vmx.c) And, i noticed 'ept' is not supported on your box, that means 'enable_unrestricted_guest' is disabled. I guess something was wrong when emulate big real mode. Could you reload kvm-intel.ko with 'emulate_invalid_guest_state = 0', and see what will happen. Reply-To: xiaoguangrong@linux.vnet.ibm.com Sorry, forgot to CC Lucio Crusca. On 11/27/2012 04:09 AM, Xiao Guangrong wrote: > On 11/24/2012 09:44 PM, bugzilla-daemon@bugzilla.kernel.org wrote: >> https://bugzilla.kernel.org/show_bug.cgi?id=50921 >> >> >> >> >> >> --- Comment #5 from Lucio Crusca <lucio@sulweb.org> 2012-11-24 13:44:16 --- >> Here the first tests results: >> >> vbox modules do not make a difference (tried rmmod vboxpci vboxnetadp >> vboxnetflt vboxdrv and then kvm ...). >> >> The trace.dat is about 60M, I could upload it somewhere, however I tried >> looking at it and I'm reasonably sure it hangs here: >> >> $ trace-cmd report | grep 125\\.332 | tail >> kvm-6588 [000] 125.332264: kvm_entry: vcpu 0 >> kvm-6588 [000] 125.332264: kvm_emulate_insn: 10000:44f8: >> 75 >> 27 > > Hmm... no 'kvm_exit' message. It looks like the infinite loop is caused by: > > | /* Don't enter VMX if guest state is invalid, let the exit handler > | start emulation until we arrive back to a valid state */ > | if (vmx->emulation_required && emulate_invalid_guest_state) > | return; > > (vmx_vcpu_run in arch/x86/kvm/vmx.c) > > And, i noticed 'ept' is not supported on your box, that means > 'enable_unrestricted_guest' is disabled. I guess something was wrong > when emulate big real mode. > > Could you reload kvm-intel.ko with 'emulate_invalid_guest_state = 0', > and see what will happen. > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > @xiaoguangrong: YOU ARE THE MAN! 'emulate_invalid_guest_state = 0' did the trick, now I have win2000 running in a 3.6.7 kvm guest! Thanks. Still guessing why it works with plain kvm-intel.ko in Debian kernels is out of my reach, but I can safely shove that mystery in the when-I'll-have-time-stuff drawer and live happy with this solution meanwhile. (In reply to comment #16) > @xiaoguangrong: YOU ARE THE MAN! 'emulate_invalid_guest_state = 0' did the > trick, now I have win2000 running in a 3.6.7 kvm guest! Thanks. > > Still guessing why it works with plain kvm-intel.ko in Debian kernels is out > of > my reach, but I can safely shove that mystery in the > when-I'll-have-time-stuff > drawer and live happy with this solution meanwhile. Because emulate_invalid_guest_state = 0 was the default before 3.6.0. This is why I wanted you to try 3.5.0. Created attachment 88501 [details]
patch to implement aad (D5) instruction.
Can you see if this patch helps?
I've tried the patch in 3.6.7 (my current kernel) and I confirm it fixes the problem. My Windows2000 guest now works without specifying "emulate_invalid_guest_state = 0" to kvm-intel.ko. Did this fix go into vanilla kernels? Is 3.7.5 patched? It is queued for 3.8. (In reply to comment #21) > It is queued for 3.8. Sorry, for 3.9 A patch referencing this bug report has been merged in Linux v3.9-rc1: commit 7f662273e476e2d7ff44f411fa9f17c946480100 Author: Gleb Natapov <gleb@redhat.com> Date: Mon Dec 10 11:42:30 2012 +0200 KVM: emulator: implement AAD instruction |