Wind River Support Network

HomeDefectsLIN10-5987
Fixed

LIN10-5987 : Can't Passthrough Host CPU to Guest in WRL9

Created: Jun 13, 2019    Updated: Aug 15, 2019
Resolved Date: Jul 16, 2019
Previous ID: LIN9-8632
Found In Version: 10.17.41.15
Fix Version: 10.17.41.17
Severity: Standard
Applicable for: Wind River Linux LTS 17
Component/s: Userspace

Description

In WRL9 RCPL 19, can't passthrough host cpu to VM. The xml snippet used as below:

<cpu mode='host-model'><model fallback='allow'/></cpu>

 

Here is my test log:

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

root@intel-x86-64:~# virsh create x86-64-kvm-guest-local-qcow2.xml
error: Failed to create domain from x86-64-kvm-guest-local-qcow2.xml
error: unsupported configuration: CPU specification not supported by hypervisor

-----------

 

From the syslog:

---------

May 17 05:48:22 intel-x86-64 <195>May 17 05:48:22 libvirtd[9182]: internal error: Invalid cpuid[0] in ssbd feature
May 17 05:48:22 intel-x86-64 <195>May 17 05:48:22 libvirtd[9182]: internal error: cannot parse CPU map for x86 architecture
May 17 05:48:22 intel-x86-64 <196>May 17 05:48:22 libvirtd[9182]: Failed to get host CPU
May 17 05:48:31 intel-x86-64 <196>May 17 05:48:31 libvirtd[9182]: Failed to get host CPU
May 17 05:48:35 intel-x86-64 <196>May 17 05:48:35 libvirtd[9182]: Failed to get host CPU
May 17 05:49:14 intel-x86-64 <195>May 17 05:49:14 libvirtd[9182]: Cannot access storage file '/tmp/x86-64-kvm-guest-glibc-small-standard-dist.iso' (as uid:0, gid:0): No such file or directory
May 17 05:49:14 intel-x86-64 <195>May 17 05:49:14 libvirtd[9182]: unsupported configuration: CPU specification not supported by hypervisor

---------

If run virsh capabilities, it don't show the model and features:

-------

root@intel-x86-64:~# virsh capabilities | more
<capabilities>

<host>
 <uuid>88888888-8887-1013-0502-2508ffffffff</uuid>
 <cpu>
 <arch>x86_64</arch>
 <topology sockets='1' cores='22' threads='2'/>
 <pages unit='KiB' size='4'/>
 <pages unit='KiB' size='2048'/>
 <pages unit='KiB' size='1048576'/>
 </cpu>
 <power_management>
 <suspend_mem/>
 </power_management>
 <migration_features>
 <live/>
 <uri_transports>
 <uri_transport>tcp</uri_transport>
 <uri_transport>rdma</uri_transport>
 </uri_transports>
 </migration_features>
 <topology>
 <cells num='2'>
 <cell id='0'>
 <memory unit='KiB'>16367776</memory>
 <pages unit='KiB' size='4'>4075560</pages>

-------

 

The issue is introduced by the fix of CVE-2018-3639.

If remove the ssbd features from the /usr/share/libvirt/cpu_map.xml, it works.

-----------

--- /usr/share/libvirt/cpu_map.xml 2019-05-17 05:54:57.268893000 +0000
+++ /usr/share/libvirt/cpu_map.xml-modified 2019-05-17 05:53:58.109892000 +0000
@@ -287,9 +287,6 @@
 <feature name='perfctr_nb'>
 <cpuid function='0x80000001' ecx='0x01000000'/>
 </feature>
- <feature name='ssbd'>
- <cpuid eax_in='0x07' ecx_in='0x00' edx='0x80000000'/>
- </feature>
 
 <!-- cpuid function 0x7 ecx 0x0 features -->
 <!-- We support only ecx 0x0 now as it's done by a workaround -->
@@ -355,15 +352,6 @@
 <feature name='invtsc' migratable='no'>
 <cpuid function='0x80000007' edx='0x00000100'/>
 </feature>
- <feature name='amd-ssbd'>
- <cpuid eax_in='0x80000008' ebx='0x01000000'/>
- </feature>
- <feature name='virt-ssbd'>
- <cpuid eax_in='0x80000008' ebx='0x02000000'/>
- </feature>
- <feature name='amd-no-ssb'>
- <cpuid eax_in='0x80000008' ebx='0x04000000'/>
- </feature>
 
 <!-- models -->
 <model name='486'>

-----------

Workaround

remove the ssbd features from the cpu_map.xml

--- /usr/share/libvirt/cpu_map.xml 2019-05-17 05:54:57.268893000 +0000
+++ /usr/share/libvirt/cpu_map.xml-modified 2019-05-17 05:53:58.109892000 +0000
@@ -287,9 +287,6 @@
 <feature name='perfctr_nb'>
 <cpuid function='0x80000001' ecx='0x01000000'/>
 </feature>
- <feature name='ssbd'>
- <cpuid eax_in='0x07' ecx_in='0x00' edx='0x80000000'/>
- </feature>
 
 <!-- cpuid function 0x7 ecx 0x0 features -->
 <!-- We support only ecx 0x0 now as it's done by a workaround -->
@@ -355,15 +352,6 @@
 <feature name='invtsc' migratable='no'>
 <cpuid function='0x80000007' edx='0x00000100'/>
 </feature>
- <feature name='amd-ssbd'>
- <cpuid eax_in='0x80000008' ebx='0x01000000'/>
- </feature>
- <feature name='virt-ssbd'>
- <cpuid eax_in='0x80000008' ebx='0x02000000'/>
- </feature>
- <feature name='amd-no-ssb'>
- <cpuid eax_in='0x80000008' ebx='0x04000000'/>
- </feature>
 
 <!-- models -->
 <model name='486'>

 

Steps to Reproduce

1.  project configuration:

wrlinux-9/setup.sh --dl-layers --distros wrlinux-ovp --machines intel-x86-64 --templates feature/initramfs,feature/kdump,feature/kexec,feature/kernel-ovp-kvm,feature/sysklogd,feature/dpdk,feature/package-management --layers wr-kernel wr-ovp

 

2.  create xml with the following:

<cpu mode='host-model'><model fallback='allow'/></cpu>

 

3. start VM with the xml file, will get the error:

error: unsupported configuration: CPU specification not supported by hypervisor

 

 
Live chat
Online