Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1083969 - libguestfs-test-tool hangs when the guest is boot with -cpu host
libguestfs-test-tool hangs when the guest is boot with -cpu host
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Marcelo Tosatti
Virtualization Bugs
:
: 1038427 (view as bug list)
Depends On:
Blocks: 833649
  Show dependency treegraph
 
Reported: 2014-04-03 06:22 EDT by Qian Guo
Modified: 2015-03-05 06:48 EST (History)
9 users (show)

See Also:
Fixed In Version: kernel-3.10.0-186.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 06:48:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libguestfs-test-tool result of cpu host (15.20 KB, text/plain)
2014-04-03 06:23 EDT, Qian Guo
no flags Details
libguestfs-test-tool result of cpu SandyBridge (48.13 KB, text/plain)
2014-04-03 06:23 EDT, Qian Guo
no flags Details
test with comment7, libguestfs-test-tool can finish with -cpu host (47.61 KB, text/plain)
2014-09-22 23:12 EDT, Qian Guo
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0290 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2015-03-05 11:13:58 EST

  None (edit)
Description Qian Guo 2014-04-03 06:22:24 EDT
Description of problem:
Boot guest with -cpu host in host which nested enabled, when run the libguestfs-test-tool, the tool hangs at 
...
[    1.347651] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
...
Version-Release number of selected component (if applicable):
kernel of both host and guest:
# uname -r
3.10.0-118.el7.x86_64

# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-1.5.3-60.el7ev.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Enable nested in host:
# modprobe -r kvm_intel
# modprobe kvm_intel nested=1
# cat /sys/module/kvm_intel/parameters/nested 
Y

2.Boot rhel7 guest with -cpu host:
# /usr/libexec/qemu-kvm -S -name rhel7 -M pc -nodefaults -vga std  -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 -drive id=drive_image1,if=none,cache=none,aio=native,file=/home/rhel70326cp1.qcow2_v3 -device virtio-blk-pci,id=image1,drive=drive_image1,bus=pci.0,addr=04 -device virtio-net-pci,mac=16:33:3f:09:12:78,id=vnet0,netdev=hostdev0,bus=pci.0,addr=05 -netdev tap,id=hostdev0,vhost=on,script=/etc/qemu-ifup -m 4G -smp 4,sockets=1,cores=4,threads=1 -cpu host  -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :3 -rtc base=localtime,clock=host,driftfix=slew -boot menu=on -enable-kvm -monitor stdio -qmp unix:/tmp/q1,server,nowait -device virtio-balloon-pci,id=b1

3.Inside guest:
# libguestfs-test-tool

Actual results:
The tool hangs at 

...
[    1.347651] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
...

Expected results:
libguestfs-test-tool can finish successfully

Additional info:
Host infos (24 cpus in total)
# cat /proc/cpuinfo  
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 45
model name	: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz
stepping	: 7
microcode	: 0x710
cpu MHz		: 2221.093
cache size	: 15360 KB
physical id	: 0
siblings	: 12
core id		: 0
cpu cores	: 6
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 4000.13
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

.....
.....

processor	: 23
vendor_id	: GenuineIntel
cpu family	: 6
model		: 45
model name	: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz
stepping	: 7
microcode	: 0x710
cpu MHz		: 1460.156
cache size	: 15360 KB
physical id	: 1
siblings	: 12
core id		: 5
cpu cores	: 6
apicid		: 43
initial apicid	: 43
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips	: 4004.59
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:


2.Test with -cpu SandyBridge/Penryn, won't hit this issue.

3.Will attach the whole logs of -cpu host and -cpu SandyBridge
Comment 1 Qian Guo 2014-04-03 06:23:10 EDT
Created attachment 882211 [details]
libguestfs-test-tool result of cpu host
Comment 2 Qian Guo 2014-04-03 06:23:38 EDT
Created attachment 882212 [details]
libguestfs-test-tool result of cpu SandyBridge
Comment 4 Qian Guo 2014-04-03 06:58:46 EDT
According to bug 986048 comment 31 , I reproduced this issue and file this bug, this bug is not a regression.
Comment 5 Ademar Reis 2014-04-04 14:13:43 EDT
Reassigning to Marcelo. Maybe it's a dupe of Bug 1038427?
Comment 6 Marcelo Tosatti 2014-04-11 17:24:04 EDT
(In reply to Ademar Reis from comment #5)
> Reassigning to Marcelo. Maybe it's a dupe of Bug 1038427?

Ademar, it is not because bug of BZ 1038427 results in 

[70040.943669] nested_vmx_run: VMCS MSR_{LOAD,STORE} unsupported
Comment 9 Qian Guo 2014-09-22 23:12:43 EDT
Created attachment 940236 [details]
test with comment7, libguestfs-test-tool can finish with -cpu host
Comment 11 Marcelo Tosatti 2014-09-24 13:47:14 EDT
*** Bug 1038427 has been marked as a duplicate of this bug. ***
Comment 13 Jarod Wilson 2014-10-10 15:44:34 EDT
Patch(es) available on kernel-3.10.0-186.el7
Comment 16 Qian Guo 2014-11-05 03:12:55 EST
Reproduced this bug with kernel-3.10.0-183.el7

Steps:
1.Confirm nested =1
# cat /sys/module/kvm_intel/parameters/nested 
Y

2.Boot guest with -cpu host
# /usr/libexec/qemu-kvm -S -name rhel7 -M pc -nodefaults -vga std  -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 -drive id=drive_image1,if=none,cache=none,aio=native,file=/home/rhel7u1/rhel7u1cp1.qcow2 -device virtio-blk-pci,id=image1,drive=drive_image1,bus=pci.0,addr=04 -device virtio-net-pci,mac=16:33:3f:09:12:78,id=vnet0,netdev=hostdev0,bus=pci.0,addr=05 -netdev tap,id=hostdev0,vhost=on,script=/etc/qemu-ifup -m 4G -smp 4,sockets=1,cores=4,threads=1 -cpu host  -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :3 -rtc base=localtime,clock=host,driftfix=slew -boot menu=on -enable-kvm -monitor stdio -qmp unix:/tmp/q1,server,nowait -device virtio-balloon-pci,id=b1 

3.Inside guest:
# libguestfs-test-tool

Actual results:
The tool hangs at 

...
NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
...

So this bug is reproduced 

Verify this bug with kernel-3.10.0-197.el7.x86_64 and qemu-kvm-rhev-2.1.2-6.el7.x86_64

Steps as above,

result, 
Guest# libguestfs-test-tool 
     ************************************************************
     *                    IMPORTANT NOTICE
     *
     * When reporting bugs, include the COMPLETE, UNEDITED
     * output below in your bug report.
     *
     ************************************************************
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
SELinux: Enforcing
...
libguestfs: closing guestfs handle 0x7fb2fcb2de80 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfstIGn2Z
===== TEST FINISHED OK =====

So this bug is fixed
Comment 18 errata-xmlrpc 2015-03-05 06:48:14 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0290.html

Note You need to log in before you can comment on or make changes to this bug.