Skip to contentSkip to conversation

warning: host doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]

kvm-unit-tests Li Zhijian 2 participants 3 messages Aug 15, 2017 – Aug 21, 2017 KVM

lore
Share & tools
lore

Li Zhijian

author
#0 lore raw

Hi guys

i encountered a problem when i test vmx related cases

the test log like below
[adam@skylake kvm-unit-tests]$ ./run_tests.sh
SKIP vmx_null (0 tests)
[adam@skylake kvm-unit-tests]$ cat logs/
SUMMARY vmx_null.log
[adam@skylake kvm-unit-tests]$ cat logs/vmx_null.log
warning: host doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
timeout -k 1s --foreground 90s /usr/bin/qemu-system-x86_64 -nodefaults -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -machine accel=kvm -kernel x86/vmx.flat -smp 1 -cpu host,+vmx -append null # -initrd /tmp/tmp.wTXf483ild enabling apic
paging enabled
cr0 = 80010011
cr3 = 469000
cr4 = 20
WARNING: vmx not supported, add '-cpu host'
SUMMARY: 0 tests

why the test output this warning, my skylake i5-6500 machine can support vmx feature, and how i can fix it. i tried the same test at my another haswell(i7-4790) machine(has the same kernel) doesn't occur this issue.

my test environmnet:
-------------------------------------
[adam@skylake kvm-unit-tests]$ qemu-system-x86_64 --version QEMU emulator version 2.9.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

[adam@skylake kvm-unit-tests]$ git log |head -1
commit 9e5e817be8634bd9800253f404aa9d53d0742131

[adam@skylake kvm-unit-tests]$ uname -a
Linux skylake 4.12.0 #1 SMP Tue Aug 15 11:23:42 CST 2017 x86_64 GNU/Linux

[adam@skylake kvm-unit-tests]$ uname -a
Linux skylake 4.12.0 #1 SMP Tue Aug 15 11:23:42 CST 2017 x86_64 GNU/Linux [adam@skylake kvm-unit-tests]$ lscpu

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               94
Model name:          Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
Stepping:            3
CPU MHz:             3600.000
CPU max MHz:         3600.0000
CPU min MHz:         800.0000
BogoMIPS:            6384.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            6144K
NUMA node0 CPU(s):   0-3
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 art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp

-------------------------------------

#1 lore raw

2017-08-15 16:39+0800, Li Zhijian:

Quoted 20 lines

Hi guys

i encountered a problem when i test vmx related cases

the test log like below
[adam@skylake kvm-unit-tests]$ ./run_tests.sh
SKIP vmx_null (0 tests)
[adam@skylake kvm-unit-tests]$ cat logs/
SUMMARY vmx_null.log
[adam@skylake kvm-unit-tests]$ cat logs/vmx_null.log
warning: host doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
timeout -k 1s --foreground 90s /usr/bin/qemu-system-x86_64 -nodefaults -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -machine accel=kvm -kernel x86/vmx.flat -smp 1 -cpu host,+vmx -append null # -initrd /tmp/tmp.wTXf483ild enabling apic
paging enabled
cr0 = 80010011
cr3 = 469000
cr4 = 20
WARNING: vmx not supported, add '-cpu host'
SUMMARY: 0 tests

Quoted 1 line

why the test output this warning, my skylake i5-6500 machine can support vmx feature, and how i can fix it.

The warning means that KVM doesn't allow the guest to see the vmx feature. You are most likely without nested vmx, because it is disabled by default:

% cat /sys/module/kvm_intel/parameters/nested
N

In order to turn it on, reload the "kvm_intel" module with "nested=Y" parameter.

modprobe -r kvm_intel; modprobe kvm_intel nested=y

If you want to have this automatically, add

options kvm_intel nested=1

to /etc/modprobe.d/kvm.conf.

Quoted 1 line

i tried the same test at my another haswell(i7-4790) machine(has the same kernel) doesn't occur this issue.

Not sure why it works on the other machine -- is it a different distro?

Thanks.

author
#2 lore raw
In reply to Li Zhijian
Quoted 6 lines
Quoted 1 line

/Hi guys/ >// >/i encountered a problem when i test vmx related

cases/ >// >/the test log like below/ >/[adam@skylake kvm-unit-tests]$ ./run_tests.sh/ >/SKIP vmx_null (0 tests)/ >/[adam@skylake kvm-unit-tests]$ cat logs// >/SUMMARY vmx_null.log/ >/[adam@skylake kvm-unit-tests]$ cat logs/vmx_null.log/ >/warning: host doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]/ >/timeout -k 1s
--foreground 90s /usr/bin/qemu-system-x86_64 -nodefaults -device
pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none
-serial stdio -device pci-testdev -machine accel=kvm -kernel
x86/vmx.flat -smp 1 -cpu host,+vmx -append null # -initrd /tmp/tmp.wTXf483ild/ >/enabling apic/ >/paging enabled/ >/cr0 = 80010011/ >/cr3 = 469000/ >/cr4 = 20/ >/WARNING: vmx not supported, add '-cpu host'/ >/SUMMARY: 0 tests/ >// >/why the test output this warning, my skylake i5-6500 machine can support vmx feature, and how i can fix it./ The warning means that KVM doesn't allow the guest to see the vmx feature. You are most likely without nested vmx, because it is disabled by default: % cat /sys/module/kvm_intel/parameters/nested N In order to turn it on, reload the "kvm_intel" module with "nested=Y" parameter. modprobe -r kvm_intel; modprobe kvm_intel nested=y

Thank you very much, it works for me

Quoted 1 line

If you want to have this automatically, add options kvm_intel nested=1 to /etc/modprobe.d/kvm.conf. >/i tried the same test at my another haswell(i7-4790) machine(has the same kernel) doesn't occur this issue./ Not sure why it works on the other machine -- is it a different distro?

you are right, the skylake is Archlinux while the haswell is Ubuntu.

Thanks
Zhijian

Quoted 1 line

Thanks.