Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 431640 - app-emulation/qemu-kvm-1.1.1-r1 - with "-cpu host": Kernel panic - not syncing: Attempted to kill init!
Summary: app-emulation/qemu-kvm-1.1.1-r1 - with "-cpu host": Kernel panic - not syncin...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo QEMU Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-16 16:28 UTC by Till Schäfer
Modified: 2013-02-19 22:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel panic screenshot (kernel_panic.png,15.74 KB, image/png)
2012-08-16 16:28 UTC, Till Schäfer
Details
kernel panic screenshot (png) (kernel_panic.png,15.74 KB, image/png)
2012-08-16 16:29 UTC, Till Schäfer
Details
cpuinfo (cpuinfo.out,7.38 KB, text/plain)
2012-08-28 23:28 UTC, Stefan Kuhn
Details
emerge --info -v (emerge-info-v.out,14.28 KB, text/plain)
2012-08-28 23:29 UTC, Stefan Kuhn
Details
lspci -v (lspci.out,8.53 KB, text/plain)
2012-08-28 23:29 UTC, Stefan Kuhn
Details
guest output of kernel panic (serial console output) (serial_out.txt,9.32 KB, text/plain)
2012-09-10 10:21 UTC, Till Schäfer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2012-08-16 16:28:36 UTC
After Upgrading to app-emulation/qemu-kvm-1.1.1-r1 from version 1.0.1-r1 my virtual machines (running gentoo linux) panic at intel_pmu_init. (detailed information including stacktrace are in the uploaded screenshot). When i remove the "-cpu host" option, the system starts normally. 

the command line from whicht the system is bootet: 

qemu-kvm -vnc :7 -usbdevice tablet -daemonize -m 256 -drive file=/data/virtual_machines/wgs-l08.img,if=virtio  -boot c -k de -net nic,model=virtio,macaddr=12:12:00:12:34:63,vlan=0 -net tap,ifname=qtap6,script=no,downscript=no,vlan=0 -smp 2 -enable-kvm -cpu host -monitor unix:/var/run/qemu-kvm/wgs-l08.monitor,server,nowait

This bug is possibly related to Bug 431444.

Reproducible: Always




Host: 
# emerge --info
Portage 2.2.0_alpha121 (hardened/linux/amd64/no-multilib, gcc-4.5.3, glibc-2.15-r2, 3.4.2-hardened-r1 x86_64)
=================================================================
System uname: Linux-3.4.2-hardened-r1-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.1
Timestamp of tree: Thu, 16 Aug 2012 10:30:01 +0000
ccache version 3.1.7 [enabled]
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo local_overlay
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -fforce-addr"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe -fforce-addr"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --autounmask-write"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 bash-completion berkdb bzip2 cli cracklib crypt cups cxx dri gdbm glib glibc gpm hardened iconv ieee1394 ipv4 ipv6 justify mmx mmxext modules mudflap ncurses nfsv4 nls nptl openmp opensslcrypt pam pax_kernel pcre pppd readline samba session sse sse2 sse3 sse4_1 ssl ssse3 syslog tcpd threads unicode urandom vim-syntax zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Till Schäfer 2012-08-16 16:28:59 UTC
Created attachment 321488 [details]
kernel panic screenshot
Comment 2 Till Schäfer 2012-08-16 16:29:42 UTC
Created attachment 321490 [details]
kernel panic screenshot (png)
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-08-16 16:33:19 UTC
Comment on attachment 321490 [details]
kernel panic screenshot (png)

You can click Details and edit the MIME type.
Comment 4 Till Schäfer 2012-08-16 16:52:36 UTC
i also reported it upstream as it does not seems to be very gentoo specific: 

https://bugs.launchpad.net/qemu/+bug/1037675
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2012-08-16 20:33:35 UTC
Likely a dup of #431444.
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2012-08-16 20:43:01 UTC
Please duplicate this without using a hardened kernel. Use a vanilla-sources or gentoo-sources kernel.
Comment 7 Till Schäfer 2012-08-17 10:34:30 UTC
i will try it with a vanilla kernel in a few days. currently the server is in use. therefore i cannot reboot it.
Comment 8 Stefan Kuhn 2012-08-28 23:25:48 UTC
Same issue here (same screenshot with qemu-kvm-1.1.1-r1), but not on hardened. 
Happens with 1.1.1-r3 with a different panic message (not the one
mentioned in bug #431444)

I fail miserably at "sending output to serial console or file", if anyone
would help me there I could provide the entire output of the kernel panic.

Below is what I've found out to far:
(Tests with qemu-kvm-1.1.1-r1)

Analysis:
=========
Happens with the following LiveCDs:
- Fedora-17-x86_64-netinst.iso: uname -r = 3.3.4-5.fc17.x86_64; image: /LiveOS/squashfs.img
- pentoo-x86_64-2012.0_beta1.7.iso: uname -r = 3.4.2-pentoo; image: image.squashfs

Does not happen with:
- pentoo-x86_64-2009.0.iso: uname -r = 2.6.31-pentoo-r3; image: image.squashfs
- (Gentoo) install-amd64-minimal-20120621.iso: uname -r = 3.2.12-gentoo; image.squashfs
- systemrescuecd-x86-2.8.1.iso (64bit kernel): uname -r = 3.2.23-std281-amd64: sysrcd.dat

Tried installing qemu-kvm-1.1.1-r1 without the 2 patches, no difference.

Guess:
======
This seems to happen only with newer guest-kernels (on newer CPUs).

Hardware-Info:
==============
see attachments
Comment 9 Stefan Kuhn 2012-08-28 23:28:41 UTC
Created attachment 322489 [details]
cpuinfo
Comment 10 Stefan Kuhn 2012-08-28 23:29:08 UTC
Created attachment 322491 [details]
emerge --info -v
Comment 11 Stefan Kuhn 2012-08-28 23:29:28 UTC
Created attachment 322493 [details]
lspci -v
Comment 12 Doug Goldstein (RETIRED) gentoo-dev 2012-09-10 02:48:26 UTC
(In reply to comment #8)
> Same issue here (same screenshot with qemu-kvm-1.1.1-r1), but not on
> hardened. 
> Happens with 1.1.1-r3 with a different panic message (not the one
> mentioned in bug #431444)
> 
> I fail miserably at "sending output to serial console or file", if anyone
> would help me there I could provide the entire output of the kernel panic.
> 
> Below is what I've found out to far:
> (Tests with qemu-kvm-1.1.1-r1)
> 
> Analysis:
> =========
> Happens with the following LiveCDs:
> - Fedora-17-x86_64-netinst.iso: uname -r = 3.3.4-5.fc17.x86_64; image:
> /LiveOS/squashfs.img
> - pentoo-x86_64-2012.0_beta1.7.iso: uname -r = 3.4.2-pentoo; image:
> image.squashfs
> 
> Does not happen with:
> - pentoo-x86_64-2009.0.iso: uname -r = 2.6.31-pentoo-r3; image:
> image.squashfs
> - (Gentoo) install-amd64-minimal-20120621.iso: uname -r = 3.2.12-gentoo;
> image.squashfs
> - systemrescuecd-x86-2.8.1.iso (64bit kernel): uname -r =
> 3.2.23-std281-amd64: sysrcd.dat
> 
> Tried installing qemu-kvm-1.1.1-r1 without the 2 patches, no difference.
> 
> Guess:
> ======
> This seems to happen only with newer guest-kernels (on newer CPUs).
> 
> Hardware-Info:
> ==============
> see attachments

Can you include the EXACT command line to qemu that you used to start this up? I'd really like to test this on my hardware.
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2012-09-10 02:53:31 UTC
(In reply to comment #0)
> After Upgrading to app-emulation/qemu-kvm-1.1.1-r1 from version 1.0.1-r1 my
> virtual machines (running gentoo linux) panic at intel_pmu_init. (detailed
> information including stacktrace are in the uploaded screenshot). When i
> remove the "-cpu host" option, the system starts normally. 
> 
> the command line from whicht the system is bootet: 
> 
> qemu-kvm -vnc :7 -usbdevice tablet -daemonize -m 256 -drive
> file=/data/virtual_machines/wgs-l08.img,if=virtio  -boot c -k de -net
> nic,model=virtio,macaddr=12:12:00:12:34:63,vlan=0 -net
> tap,ifname=qtap6,script=no,downscript=no,vlan=0 -smp 2 -enable-kvm -cpu host
> -monitor unix:/var/run/qemu-kvm/wgs-l08.monitor,server,nowait

Can you try -cpu host,-avx ?
Comment 14 Till Schäfer 2012-09-10 09:50:01 UTC
thx for the patience, i am currently very busy, therefore this took a bit longer than it was planed:

1. using a non hardened kernel (gentoo-sources-3.3.8) does not resolve the issue

2. using -cpu host,-avx does not solve the issue


therefore i need to use the serial console, which is also somewhat new to me. i will do this as soon as i find some time. so i am still on it ;)
Comment 15 Till Schäfer 2012-09-10 10:21:06 UTC
ok i got the serial console to work: 

this seems the relevant part of the guest kernel panic (full output is attached in file):

[    0.010706] mce: CPU supports 10 MCE banks
[    0.011279] ACPI: Core revision 20110623
[    0.014769] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.025876] CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
[    0.027998] Performance Events: 
[    0.027998] general protection fault: 0000 [#1] SMP 
[    0.027998] CPU 0 
[    0.027998] Modules linked in:
[    0.027998] 
[    0.027998] Pid: 1, comm: swapper/0 Not tainted 3.2.12-gentoo #1 Bochs Bochs
[    0.027998] RIP: 0010:[<ffffffff81aa553f>]  [<ffffffff81aa553f>] intel_pmu_init+0x283/0x85e
[    0.027998] RSP: 0018:ffff88000f8b9ea0  EFLAGS: 00000202
[    0.027998] RAX: 0000000000000003 RBX: 0000000000000000 RCX: 0000000000000345
[    0.027998] RDX: 0000000000000003 RSI: 0000000007280202 RDI: ffffffff81a7efa8
[    0.027998] RBP: ffff88000f8b9eb0 R08: 0000000000000000 R09: ffffffff81a7ee70
[    0.027998] R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff81aa4955
[    0.027998] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[    0.027998] FS:  0000000000000000(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
[    0.027998] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[    0.027998] CR2: 0000000000000000 CR3: 0000000001a05000 CR4: 00000000000006f0
[    0.027998] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    0.027998] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[    0.027998] Process swapper/0 (pid: 1, threadinfo ffff88000f8b8000, task ffff88000f8b0000)
[    0.027998] Stack:
[    0.027998]  0000000000000000 ffffffff81b1b550 ffff88000f8b9ef0 ffffffff81aa4989
[    0.027998]  0000000000000040 ffffffff81a800d8 ffff88000f8b9f20 ffffffff81b1b550
[    0.027998]  ffffffff81aa4955 0000000000000000 ffff88000f8b9f20 ffffffff810002ea
[    0.027998] Call Trace:
[    0.027998]  [<ffffffff81aa4989>] init_hw_perf_events+0x34/0x3ef
[    0.027998]  [<ffffffff81aa4955>] ? check_bugs+0x2d/0x2d
[    0.027998]  [<ffffffff810002ea>] do_one_initcall+0x7a/0x12c
[    0.027998]  [<ffffffff81a9eb45>] kernel_init+0x7a/0x141
[    0.027998]  [<ffffffff814963b4>] kernel_thread_helper+0x4/0x10
[    0.027998]  [<ffffffff81a9eacb>] ? start_kernel+0x339/0x339
[    0.027998]  [<ffffffff814963b0>] ? gs_change+0xb/0xb
[    0.027998] Code: 48 d3 e0 48 ff c8 41 ff ca 48 89 05 b4 99 fd ff 7e 2b 83 e2 1f b8 03 00 00 00 83 fa 02 b9 45 03 00 00 0f 4f c2 89 05 91 99 fd ff <0f> 32 48 c1 e2 20 89 c0 48 09 c2 48 89 15 ef 99 fd ff e8 cf be 
[    0.027998] RIP  [<ffffffff81aa553f>] intel_pmu_init+0x283/0x85e
[    0.027998]  RSP <ffff88000f8b9ea0>
[    0.029015] ---[ end trace 4eaa2a86a8e2da22 ]---
[    0.030006] swapper/0 used greatest stack depth: 5576 bytes left
[    0.031005] Kernel panic - not syncing: Attempted to kill init!
[    0.032006] Pid: 1, comm: swapper/0 Tainted: G      D      3.2.12-gentoo #1
[    0.033000] Call Trace:
[    0.034003]  [<ffffffff8148d64e>] panic+0x8c/0x198
[    0.035005]  [<ffffffff8103e1f0>] do_exit+0x98/0x7d8
[    0.036005]  [<ffffffff8103c564>] ? kmsg_dump+0x46/0xd2
[    0.037007]  [<ffffffff81490078>] oops_end+0xb1/0xb9
[    0.038001]  [<ffffffff81004bd9>] die+0x55/0x60
[    0.039005]  [<ffffffff8148fd30>] do_general_protection+0x12e/0x136
[    0.040001]  [<ffffffff81aa4955>] ? check_bugs+0x2d/0x2d
[    0.041005]  [<ffffffff8148f83f>] general_protection+0x1f/0x30
[    0.042001]  [<ffffffff81aa4955>] ? check_bugs+0x2d/0x2d
[    0.043004]  [<ffffffff81aa553f>] ? intel_pmu_init+0x283/0x85e
[    0.044001]  [<ffffffff81aa4989>] init_hw_perf_events+0x34/0x3ef
[    0.045005]  [<ffffffff81aa4955>] ? check_bugs+0x2d/0x2d
[    0.046003]  [<ffffffff810002ea>] do_one_initcall+0x7a/0x12c
[    0.047003]  [<ffffffff81a9eb45>] kernel_init+0x7a/0x141
[    0.048000]  [<ffffffff814963b4>] kernel_thread_helper+0x4/0x10
[    0.049000]  [<ffffffff81a9eacb>] ? start_kernel+0x339/0x339
[    0.050008]  [<ffffffff814963b0>] ? gs_change+0xb/0xb
Comment 16 Till Schäfer 2012-09-10 10:21:45 UTC
Created attachment 323390 [details]
guest output of kernel panic (serial console output)
Comment 17 Till Schäfer 2012-09-11 10:59:19 UTC
+CONFIG_KVM_CLOCK=y
+CONFIG_KVM_GUEST=y
+CONFIG_PARAVIRT=y
+CONFIG_PARAVIRT_CLOCK=y

enabling there options in the guest kernel solves the problem
Comment 18 James Le Cuirot gentoo-dev 2012-10-09 20:26:28 UTC
I am seeing more or less the same thing. I am trying to boot Puppy Linux from Gentoo with qemu-kvm-1.1.1-r3 and gentoo-sources-3.6.0. Interestingly, I also found that AROS crashed when using "-cpu host" but I initially chalked that up to AROS being flakey - perhaps not. Obviously I can't enable those kernel options in AROS and I don't want to have to build my own Puppy kernel.
Comment 19 Doug Goldstein (RETIRED) gentoo-dev 2012-10-09 21:48:05 UTC
Please retest with app-emulation/qemu-1.1.2. Note app-emulation/qemu-kvm has moved to app-emulation/qemu.
Comment 20 James Le Cuirot gentoo-dev 2012-10-10 21:07:30 UTC
1.1.2 doesn't help, I'm afraid. Same result.
Comment 21 Jaco Kroon 2013-02-19 22:21:29 UTC
http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg01486.html

Some config options in the guest you need to enable. Worked for me to enable paravirtualization + KVM support.