2017-03-03 96 views
-1

我在Ubuntu Server 16.04上安装了libvirt-bin。但我发现的奇怪的事情是,libvirt没有列出主机的所有支持的CPU功能。Libvirt没有列出所有支持的CPU功能

当我打开文件/ proc/cpuinfo时,可以看到'aes'在标志列表中。

但是,当我运行'virsh功能'时,我得到下面的结果,这表明主机cpu没有功能'aes'。

<capabilities> 

    <host> 
    <uuid>30373237-3132-4d32-3236-30383034485a</uuid> 
    <cpu> 
     <arch>x86_64</arch> 
     <model>SandyBridge</model> 
     <vendor>Intel</vendor> 
     <topology sockets='1' cores='10' threads='2'/> 
     <feature name='invpcid'/> 
     <feature name='erms'/> 
     <feature name='bmi2'/> 
     <feature name='smep'/> 
     <feature name='avx2'/> 
     <feature name='bmi1'/> 
     <feature name='fsgsbase'/> 
     <feature name='abm'/> 
     <feature name='pdpe1gb'/> 
     <feature name='rdrand'/> 
     <feature name='f16c'/> 
     <feature name='osxsave'/> 
     <feature name='movbe'/> 
     <feature name='dca'/> 
     <feature name='pcid'/> 
     <feature name='pdcm'/> 
     <feature name='xtpr'/> 
     <feature name='fma'/> 
     <feature name='tm2'/> 
     <feature name='est'/> 
     <feature name='smx'/> 
     <feature name='vmx'/> 
     <feature name='ds_cpl'/> 
     <feature name='monitor'/> 
     <feature name='dtes64'/> 
     <feature name='pbe'/> 
     <feature name='tm'/> 
     <feature name='ht'/> 
     <feature name='ss'/> 
     <feature name='acpi'/> 
     <feature name='ds'/> 
     <feature name='vme'/> 
    </cpu> 
... 

然后我打开文件/usr/share/libvirt/cpu_map.xml,我可以看到下面的CPU型号,这意味着从了Sandbridge继承的Westmere,它应该具有的特征“AES”。

<model name='Westmere'> 
    <model name='Nehalem'/> 
    <feature name='aes'/> 
</model> 

<model name='SandyBridge'> 
    <model name='Westmere'/> 
    <feature name='pclmuldq'/> 
    <feature name='x2apic'/> 
    <feature name='tsc-deadline'/> 
    <feature name='xsave'/> 
    <feature name='avx'/> 
    <feature name='rdtscp'/> 
</model> 

我认为/ proc/cpuinfo中的标志列表应该是正确的,因为它是由linux内核调用cpuid生成的。这是libvirt中的错误,还是'aes'只是'virsh功能'输出中某些列出功能的子集?

更有趣的是,在我启动一个guest和登录后,我发现在guest os中,'aes'位于/ proc/cpuinfo中。

有什么想法?

谢谢, 托比

回答

0

在libvirt的CPU设计中,CPU型号名称被当作一组的CPU功能的短切/别名。因此,当您查询容量XML中的主机CPU模型时,您会看到一些表示核心功能集的CPU模型,然后列出了零个或多个尚未列为基本CPU模型的功能。您的示例显示“SandyBridge”作为功能中的CPU模型。这继承了“Westmere”,并且“Westmere”被宣布包含“aes”特征。因此,libvirt不需要在功能中列出“aes”功能 - 它只需要列出已经属于“SandyBridge”模型的而不是的功能。

如果您想查看CPU功能的完整展开列表,可以将.... XML保存到文件CPUMODEL.xml,然后调用“virsh cpu-baseline --features CPUMODEL.xml”。