RHEV/KVM: how are the CPU models mapped to the CPU flags?

219 篇文章 2 订阅

https://access.redhat.com/solutions/2574771

RHEV/KVM: how are the CPU models mapped to the CPU flags?

 SOLUTION IN PROGRESS - 已更新 2016年八月26日12:25 - 

English 

环境

  • Red Hat Virtualization 4
  • Red Hat Enterprise Virtualization 3
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
    • libvirt
    • qemu-kvm

问题

  • Where can I find the mapping between CPU models and flags for Virtualization?
  • How can I enabled or disable a specific feature/flag?
  • Which CPU flags are enabled when I select Sandy Bridge?
  • Which CPU flags are enabled when I select Haswell?
  • Which CPU flags are enabled when I select Broadwell?
  • Which CPU flags are enabled when I select Opteron_G5?

决议

The definitions are stored in /usr/share/libvirt/cpu_map.xml.

Raw

$ cat /usr/share/libvirt/cpu_map.xml | egrep 'Opteron_G5|Broadwell' -A5
    <model name='Broadwell'>
      <vendor name='Intel'/>
      <feature name='3dnowprefetch'/>
      <feature name='adx'/>
      <feature name='aes'/>
      <feature name='apic'/>
      ...
--
    <model name='Opteron_G5'>
      <vendor name='AMD'/>
      <feature name='3dnowprefetch'/>
      <feature name='abm'/>
      <feature name='aes'/>
      <feature name='apic'/>
      ...

NOTE: the below is not valid for Red Hat Virtualization. It's only intended for RHEL KVM.

To enable or disable a specific flag, edit the VM definition using virsh edit <vm name> and edit the cpu section of the xml with:

Raw

  <cpu ....>
    <feature policy='policy' name='flag'/>
  </cpu>

Where flag is the feature, such as vmx. And policy is one of the below:

PolicyDescription
forceThe virtual CPU will claim the feature is supported regardless of it being supported by host CPU.
requireGuest creation will fail unless the feature is supported by host CPU.
optionalThe feature will be supported by virtual CPU if and only if it is supported by host CPU.
disableThe feature will not be supported by virtual CPU.
forbidGuest creation will fail if the feature is supported by host CPU.

 

For example, to require the vmx feature to be passed to the Virtual Machine CPU:

Raw

  <cpu ....>
    <feature policy='require' name='vmx'/>
  </cpu>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值