lost and found ( for me ? )

KVM : CPU host-passthrough

“CPU host-passthrough” causes libvirt to tell KVM to passthrough the host CPU with no modification

# cat /etc/fedora-release ;uname -ri;qemu-system-x86_64 --version
Fedora release 19 (Schrödinger’s Cat)
3.10.6-200.fc19.x86_64 x86_64
QEMU emulator version 1.6.0, Copyright (c) 2003-2008 Fabrice Bellard



add red lines in a VM’s xml file
 <vcpu placement='static'>1</vcpu>
 <resource>
   <partition>/machine</partition>
 </resource>
 <os>
   <type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
   <boot dev='hd'/>
 </os>
 <features>
   <acpi/>
   <apic/>
   <pae/>
 </features>
 <cpu mode='host-passthrough'>
 </cpu>

nn, different CPU flags..
Seen from “https://wiki.openstack.org/wiki/LibvirtXMLCPUModel”, it describes that “the difference to host-model, instead of just matching feature flags, every last detail of the host CPU is matched.”

KVM host
model name : AMD Phenom(tm) II X4 925 Processor
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save

VM
model name : AMD Phenom(tm) II X4 925 Processor
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb lm 3dnowext 3dnow up rep_good extd_apicid unfair_spinlock pni cx16 x2apic popcnt hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw npt nrip_save

You can check what kind of CPU type you can specify to VMs.
# cat /usr/share/libvirt/cpu_map.xml
<cpus>
 <arch name='x86'>
   <!-- vendor definitions -->
   <vendor name='Intel' string='GenuineIntel'/>
   <vendor name='AMD' string='AuthenticAMD'/>

   <!-- standard features, EDX -->
   <feature name='fpu'> <!-- CPUID_FP87 -->
     <cpuid function='0x00000001' edx='0x00000001'/>
   </feature>



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.