Bug 1083969

Summary: libguestfs-test-tool hangs when the guest is boot with -cpu host
Product: Red Hat Enterprise Linux 7 Reporter: Qian Guo <qiguo>
Component: kernelAssignee: Marcelo Tosatti <mtosatti>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: choma, hhuang, juzhang, knoel, lilu, michen, qiguo, rbalakri, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 11:48:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 833649    
Attachments:
Description Flags
libguestfs-test-tool result of cpu host
none
libguestfs-test-tool result of cpu SandyBridge
none
test with comment7, libguestfs-test-tool can finish with -cpu host none

Description Qian Guo 2014-04-03 10:22:24 UTC
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 10:23:10 UTC
Created attachment 882211 [details]
libguestfs-test-tool result of cpu host

Comment 2 Qian Guo 2014-04-03 10:23:38 UTC
Created attachment 882212 [details]
libguestfs-test-tool result of cpu SandyBridge

Comment 4 Qian Guo 2014-04-03 10:58:46 UTC
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 18:13:43 UTC
Reassigning to Marcelo. Maybe it's a dupe of Bug 1038427?

Comment 6 Marcelo Tosatti 2014-04-11 21:24:04 UTC
(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-23 03:12:43 UTC
Created attachment 940236 [details]
test with comment7, libguestfs-test-tool can finish with -cpu host

Comment 11 Marcelo Tosatti 2014-09-24 17:47:14 UTC
*** Bug 1038427 has been marked as a duplicate of this bug. ***

Comment 13 Jarod Wilson 2014-10-10 19:44:34 UTC
Patch(es) available on kernel-3.10.0-186.el7

Comment 16 Qian Guo 2014-11-05 08:12:55 UTC
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 11:48:14 UTC
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