Bug 1254420
Summary: | Add IvyBridge cpu model to libvirt | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Pei Zhang <pezhang> |
Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | chayang, dyuan, fjin, honzhang, jdenemar, juzhang, knoel, lhuang, michen, qzhang, rbalakri, xfu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.17-8.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 06:52:29 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Pei Zhang
2015-08-18 05:28:49 UTC
Sent upstream for review: https://www.redhat.com/archives/libvir-list/2015-September/msg00160.html Fixed upstream by v1.2.19-31-g8720551: commit 87205512565529b8baeb108e3d0fe376fc20c967 Author: Jiri Denemark <jdenemar> Date: Fri Sep 4 15:06:40 2015 +0200 cpu: Introduce IvyBridge CPU model https://bugzilla.redhat.com/show_bug.cgi?id=1254420 Hello, Jiri. I'm not sure what the expected results should be. There are four differences between qemu and virsh in the bug description, but the fix only include one. What about the others? # /usr/libexec/qemu-kvm -cpu ? ... *x86 IvyBridge Intel Xeon E3-12xx v2 (IvyBridge) *x86 host KVM processor with all supported host features (only available in KVM mode) # virsh cpu-models x86_64 ... *cpu64-rhel5 *pentiumpro You should expect what this bug summary says, that is, libvirt should now know about IvyBridge CPU model and should be able to use it. Hi jiri, I found there is a problem when verify this bug: When i check the cpu flags, i found IvyBridge has vme flags (CPUID_VME) but Haswell/Broadwell do not have, but the result in qemu code is different. Why IvyBridge model has the vme but Haswell/Broadwell not ? Then i wrote a script to check them one by one (maybe not correct, i was still improving it), and the result is : cannot find cpu feature named lahf_lm in cpu model qemu64 cannot find cpu feature named vme in cpu model phenom cannot find cpu feature named cx16 in cpu model phenom cannot find cpu feature named popcnt in cpu model phenom cannot find cpu feature named amd_aliases in cpu model phenom cannot find cpu feature named pdpe1gb in cpu model phenom cannot find cpu feature named rdtscp in cpu model phenom cannot find cpu feature named lahf_lm in cpu model phenom cannot find cpu feature named abm in cpu model phenom cannot find cpu feature named sse4a in cpu model phenom cannot find cpu feature named acpi in cpu model core2duo cannot find cpu feature named ss in cpu model core2duo cannot find cpu feature named cx16 in cpu model core2duo cannot find cpu feature named lahf_lm in cpu model core2duo cannot find cpu feature named vme in cpu model kvm64 cannot find cpu feature named amd_aliases in cpu model kvm64 cannot find cpu feature named popcnt in cpu model qemu32 cannot find cpu feature named vme in cpu model kvm32 cannot find cpu feature named amd_aliases in cpu model kvm32 cannot find cpu feature named acpi in cpu model coreduo cannot find cpu feature named ss in cpu model coreduo cannot find cpu feature named apic in cpu model pentium cannot find cpu feature named apic in cpu model pentium2 cannot find cpu feature named apic in cpu model pentium3 cannot find cpu feature named mca in cpu model athlon cannot find cpu feature named amd_aliases in cpu model athlon cannot find cpu feature named acpi in cpu model n270 cannot find cpu feature named ss in cpu model n270 cannot find cpu feature named movbe in cpu model n270 cannot find cpu feature named amd_aliases in cpu model n270 cannot find cpu feature named lahf_lm in cpu model n270 cannot find cpu feature named svm in cpu model cpu64-rhel6 cannot find cpu feature named vme in cpu model Conroe cannot find cpu feature named vme in cpu model Penryn cannot find cpu feature named vme in cpu model Nehalem cannot find cpu feature named vme in cpu model Westmere cannot find cpu feature named pclmulqdq in cpu model Westmere cannot find cpu feature named vme in cpu model SandyBridge cannot find cpu feature named pclmulqdq in cpu model SandyBridge cannot find cpu feature named pclmulqdq in cpu model IvyBridge cannot find cpu feature named vme in cpu model Haswell cannot find cpu feature named pclmulqdq in cpu model Haswell cannot find cpu feature named f16c in cpu model Haswell cannot find cpu feature named rdrand in cpu model Haswell cannot find cpu feature named vme in cpu model Haswell cannot find cpu feature named pclmulqdq in cpu model Haswell cannot find cpu feature named f16c in cpu model Haswell cannot find cpu feature named rdrand in cpu model Haswell cannot find cpu feature named vme in cpu model Broadwell-noTSX cannot find cpu feature named pclmulqdq in cpu model Broadwell-noTSX cannot find cpu feature named f16c in cpu model Broadwell-noTSX cannot find cpu feature named rdrand in cpu model Broadwell-noTSX cannot find cpu feature named vme in cpu model Broadwell cannot find cpu feature named pclmulqdq in cpu model Broadwell cannot find cpu feature named f16c in cpu model Broadwell cannot find cpu feature named rdrand in cpu model Broadwell cannot find cpu feature named vme in cpu model Opteron_G1 cannot find cpu feature named vme in cpu model Opteron_G2 cannot find cpu feature named vme in cpu model Opteron_G3 cannot find cpu feature named vme in cpu model Opteron_G4 cannot find cpu feature named pclmulqdq in cpu model Opteron_G4 cannot find cpu feature named vme in cpu model Opteron_G5 cannot find cpu feature named pclmulqdq in cpu model Opteron_G5 Some of the CPU flags is not in libvirt cpu_map.xml, just like pclmulqdq (CPUID_EXT_PCLMULQDQ), and some of flags are not in some model, just like f16c,vme are not in Broadwell. Is this excepted ? Thanks in advance for your reply. Luyao Some CPU features have different names in libvirt (e.g., pclmulqdq is pclmuldq), you'd have to use CPUID bits to cross check all features without having to worry about different naming. Anyway, even if older CPU models differ, we are not going to change them for backward compatibility (not to mention that their definition may differ depending on a machine type). That said, just focus on verifying IvyBridge. (In reply to Jiri Denemark from comment #9) > Some CPU features have different names in libvirt (e.g., pclmulqdq is > pclmuldq), you'd have to use CPUID bits to cross check all features without > having to worry about different naming. Anyway, even if older CPU models > differ, we are not going to change them for backward compatibility (not to > mention that their definition may differ depending on a machine type). That > said, just focus on verifying IvyBridge. Got it, thanks a lot for your clearly reply. Verify this bug with libvirt-1.2.17-9.el7.x86_64: 1. prepare a host which is IvyBridge: # cat /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt 2. check virsh capabilities: # virsh capabilities <capabilities> <host> <uuid>abc38b34-0bcb-47ad-b28a-b66e0cfc5814</uuid> <cpu> <arch>x86_64</arch> <model>IvyBridge</model> <vendor>Intel</vendor> <topology sockets='1' cores='10' threads='2'/> <feature name='invtsc'/> <feature name='pdpe1gb'/> <feature name='osxsave'/> <feature name='dca'/> <feature name='pcid'/> <feature name='pdcm'/> <feature name='xtpr'/> <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'/> <pages unit='KiB' size='4'/> <pages unit='KiB' size='2048'/> <pages unit='KiB' size='1048576'/> </cpu> ... 3. check cpu-models: # virsh cpu-models x86_64 Opteron_G5 Opteron_G4 Opteron_G3 Opteron_G2 Opteron_G1 phenom athlon Broadwell Broadwell-noTSX Haswell Haswell-noTSX IvyBridge SandyBridge Westmere Nehalem Penryn Conroe qemu64 kvm64 cpu64-rhel6 cpu64-rhel5 kvm32 qemu32 core2duo n270 coreduo pentiumpro pentium3 pentium2 pentium 486 4. start a guest which have IvyBridge: # virsh dumpxml test4 ... <cpu mode='host-model'> <model fallback='allow'/> <numa> <cell id='0' cpus='0' memory='1024000' unit='KiB'/> </numa> </cpu> ... # virsh start test4 Domain test4 started 5. recheck the xml: # virsh dumpxml test4 --update-cpu ... <cpu mode='host-model' match='exact'> <model fallback='allow'>IvyBridge</model> <vendor>Intel</vendor> <feature policy='require' name='pdpe1gb'/> <feature policy='require' name='osxsave'/> <feature policy='require' name='dca'/> <feature policy='require' name='pcid'/> <feature policy='require' name='pdcm'/> <feature policy='require' name='xtpr'/> <feature policy='require' name='tm2'/> <feature policy='require' name='est'/> <feature policy='require' name='smx'/> <feature policy='require' name='vmx'/> <feature policy='require' name='ds_cpl'/> <feature policy='require' name='monitor'/> <feature policy='require' name='dtes64'/> <feature policy='require' name='pbe'/> <feature policy='require' name='tm'/> <feature policy='require' name='ht'/> <feature policy='require' name='ss'/> <feature policy='require' name='acpi'/> <feature policy='require' name='ds'/> <numa> <cell id='0' cpus='0' memory='1024000' unit='KiB'/> </numa> </cpu> ... 6. check qemu command line: # ps aux|grep qemu qemu 34148 17.7 0.8 1619840 33100 ? Sl 06:02 0:12 /usr/libexec/qemu-kvm -name test4 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu IvyBridge,+pdpe1gb,+osxsave,+dca,+pcid,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds... And use a host is not IvyBridge and start a guest: 1. # virsh dumpxml test4 ... <cpu mode='custom' match='exact'> <model fallback='allow'>IvyBridge</model> <numa> <cell id='0' cpus='0' memory='1024000' unit='KiB'/> </numa> </cpu> ... 2. # virsh start test4 error: Failed to start domain test4 error: unsupported configuration: guest and host CPU are not compatible: Host CPU does not provide required features: erms, smep, fsgsbase, rdrand, tsc-deadline, x2apic Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2202.html |