【问题标题】:Libvirt does not list all supported CPU featuresLibvirt 没有列出所有支持的 CPU 特性
【发布时间】:2017-03-03 23:35:17
【问题描述】:

我在我的 Ubuntu Server 16.04 上安装了 libvirt-bin。但奇怪的是,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 中。

有什么想法吗?

谢谢, 托比

【问题讨论】:

    标签: ubuntu qemu kvm libvirt


    【解决方案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”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-25
      • 2016-04-30
      • 1970-01-01
      • 1970-01-01
      • 2013-03-17
      • 2023-01-31
      • 2023-01-07
      相关资源
      最近更新 更多