首页 文章

Libvirt未列出所有支持的CPU功能

提问于
浏览
1

我在我的Ubuntu Server 16.04上安装了libvirt-bin . 但我发现的奇怪之处在于libvirt没有列出主机支持的所有CPU功能 .

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

但是,当我运行'virsh capabilities'时,我得到了下面的结果,这表明主机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 capabilities'输出中某些列出的功能的一部分?

更有趣的是,在我启动访客并登录后,我发现在访客操作系统中,'aes'位于/ proc / cpuinfo中 .

任何的想法?

谢谢,托比

1 回答

  • 1

    在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” .

相关问题