Build Configuration: BB_VERSION = "1.17.1" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "Fedora-18" TARGET_SYS = "x86_64-poky-linux" MACHINE = "qemux86-64" DISTRO = "poky" DISTRO_VERSION = "1.3+snapshot-20130219" TUNE_FEATURES = "m64" TARGET_FPU = "" meta meta-yocto meta-yocto-bsp = "(nobranch):3ec4df57540421df2cda6b83c615bfb7cebccefd" bitbake core-image-minimal runqemu qemux86-64 core-image-minimal kvm nographic CPU0: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz stepping 07 Performance Events: general protection fault: 0000 [#1] PREEMPT SMP CPU 0 Modules linked in: Pid: 1, comm: swapper/0 Not tainted 3.4.28-yocto-standard #1 Bochs Bochs RIP: 0010:[<ffffffff81cc2604>] [<ffffffff81cc2604>] intel_pmu_init+0x2a8/0x59d RSP: 0018:ffff88000791be00 EFLAGS: 00000202 RAX: 0000000000000003 RBX: 0000000000000000 RCX: 0000000000000345 RDX: 0000000000000003 RSI: 0000000000000007 RDI: ffffffff81c9d660 RBP: ffff88000791be20 R08: 0000000000000000 R09: ffffffff81c9d500 R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff81cc1969 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff880007c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001c0b000 CR4: 00000000000406b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88000791a000, task ffff880007920000) Stack: 0000060300000100 0000000007300402 0000000000000000 ffffffff81d47958 ffff88000791be40 ffffffff81cc1997 ffffffff81d47958 ffffffff81cc1969 ffff88000791be70 ffffffff810002b2 ffffffff81d47958 ffff8800079205d8 Call Trace: [<ffffffff81cc1997>] init_hw_perf_events+0x2e/0x43a [<ffffffff81cc1969>] ? check_bugs+0x2d/0x2d [<ffffffff810002b2>] do_one_initcall+0x122/0x170 [<ffffffff81cb9c03>] kernel_init+0x9e/0x1f8 [<ffffffff810616a1>] ? get_parent_ip+0x11/0x50 [<ffffffff81648acd>] ? sub_preempt_count+0x6d/0xd0 [<ffffffff816451e7>] ? _raw_spin_unlock_irq+0x17/0x40 [<ffffffff8105df8b>] ? finish_task_switch+0x5b/0xc0 [<ffffffff8164d794>] kernel_thread_helper+0x4/0x10 [<ffffffff81cb9b65>] ? start_kernel+0x362/0x362 [<ffffffff8164d790>] ? gs_change+0xb/0xb Code: af fd ff 8b 45 ec 48 89 05 8a af fd ff 7e 2e 8a 55 e4 b8 03 00 00 00 b9 45 03 00 00 83 e2 1f 83 fa 02 0f 4f c2 89 05 5c af fd ff <0f> 32 48 c1 e2 20 89 c0 48 09 c2 48 89 15 d2 af fd ff e8 f5 38 RIP [<ffffffff81cc2604>] intel_pmu_init+0x2a8/0x59d RSP <ffff88000791be00> ---[ end trace c37d9dee481c2517 ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b runqemu actually runs this command: /home/stefans/yocto/builds/y1/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-x86_64 -kernel tmp/deploy/images/bzImage-qemux86-64.bin -net nic,model=virtio -net tap,vlan=0,ifname=tap0,script=no,downscript=no,vhost=on -drive file=tmp/deploy/images/core-image-minimal-qemux86-64.ext3,if=virtio -show-cursor -usb -usbdevice wacom-tablet -vga vmware -no-reboot -enable-kvm -cpu host -m 128 --append "vga=0 root=/dev/vda rw mem=128M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 " http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/recipes-kernel/linux/linux-yocto_3.4.bb?id=e6149ec6c4c14d3a939022cdc29ac94dced836dd The above commit removed guest kvm support on qemux86-64. Now, I believe it should be possible to pass --enable-kvm to qemu and run an unmodified guest without it crashing. And indeed, if I don't use runqemu and I remove "-cpu host" from the above command, it doesn't crash anymore.
Scott, can you please have a look an runqemu and whether "-cpu host" is the right option to be using here?
Hi Stefan. Can you please explain to me the rationale behind your observations? Paravirtualization is not directly related to -cpu host option, as far as I know. That is one thing. The other thing is this used to work, so clearly it is a regression. Regards, Cristian
Hi, is there an estimate when this bug will be fixed? The fact that qemux86-64 machines cannot be run with KVM impacts the performance (boot time is 2x longer), therefore impacting during the development testing.
Darren is right, I got a root cause. Patch coming up shortly.
This is caused by a restricted instruction issued on CPU type. Patch submitted that sets CPU type to qemu on all targets, and thus avoids using model-specific registers under emulation.
Hi Alex, I might be wrong, and I need more time to investigate, but I don't agree with the fix you proposed for this issue. What you propose is just a step back from how qemu should optimally work, meaning exporting "-cpu host". That's one thing. Another thing is the described issue seems to be specific to some kernels on the host. For example, I checked with LaurP and AlexG and thes issue is: - reproducible on Ubuntu 12.10 with kernel 3.5.0.27 and Fedora Core 18 with kernel 3.8.5. - not reproducible with Ubuntu 12.04 with kernel 3.2.x (need to check the exact details with LaurP). This issue needs more investigation. Regards, Cristian
Where are we with this? Is it still reproducing?
As of 676fd3f394a0c0576b63c77ed2184bf5f42c29b6 I still get the same general protection fault for: runqemu qemux86-64 core-image-sato kvm
Hi Stefan, Can you please state the host OS for running qemu? I have noticed that: On Ubuntu 12.04 x86-64 the issue is not reproducible. On Ubuntu 12.10 x86-64 the issue is reproducible. Regards, Cristian
It's the same OS as in my first comment: Fedora 18 x86-64. In the meantime kernel went from 3.8.5. to 3.9.4-200.fc18.x86_64
Ping? I still see this on poky master:67f76e6fc2d8476bdaaf500432198670b883138a, Fedora 18 3.9.6-200.fc18.x86_64
Hi, I found this bug can be reproduced on Ubuntu 13.04. But it can not be reproduced on Ubuntu 12.04. Poky is master eaa5df34af42b6a37f6506847d0f3ef6ba0d298a
This should be resolved via the updated runqemu options. If this bug can be reproduced with the runqemu script, please reopen.
This issue still happens on 1.5 M5 rc1.
This isn't fixed as of latest master 63cd03b80c3eb5b4b88774e44a4ed2cf0905f094, and I haven't seen anything going in related to this. (see earlier comments about distro/kernel versions where the panic shows up) I know this bug has been in set in REVIEW for a looong time (probably because of comment #5) but that patch has never been merged and IIRC there were some comments on the list at that time, so nothing changed here. Darren are we missing something? You said something about "updated runqemu options"... )
Stefan, how are you running the test? Is the runqemu command used?
Yup: runqemu qemux86-64 core-image-minimal kvm
Bruce, I'm hoping with your work in the virtualisation space you have a better idea than we do of what we should be passing to qemu here. Currently -cpu host is used which gets a backtrace from perf for me too. Other options appear to be qemu64, kvm64, kvm32 and qemu32. $ /qemu-system-x86_64 -cpu help x86 qemu64 QEMU Virtual CPU version 1.5.0 x86 kvm64 Common KVM processor x86 qemu32 QEMU Virtual CPU version 1.5.0 x86 kvm32 Common 32-bit KVM processor x86 host KVM processor with all supported host features (only available in KVM mode) which one do we want and why?
qemu64 and kvm64 are roughly the same, in particular if you are launching with the -enable-kvm. The latter is supposed to offer a consistent base and capability set to the VMs, the former is often the default and will present a similar ... but not as tailored set of options. My recommendation is to use the kvm cpu types if you really are launched accelerated guests all the time. If you want to mix and match, use qemu64 (and use the --enable-kvm flag to get the optional acceleration). Also note that we can beef up the capabilities as required, like so: -cpu qemu64,+x2apic Which means you can add any instruction or capability that -cpu host used to offer, but do it in a safer way.
Thanks Bruce, much appreciated. I've sent out a patch for review which fixes the problem for me locally.
Resolved in master with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=b8819b02dc4ff29d678cc55887dfe6c2d109a67d
*** Bug 4569 has been marked as a duplicate of this bug. ***
Thanks, works now. Marked as Verified.