Bug 1385705

Summary: CPU features spelling mistake: pclmuldq vs. pclmulqdq
Product: [Community] Virtualization Tools Reporter: Craig <craig>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: jdenemar, libvirt-maint, rbalakri
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-30 13:40:15 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:

Description Craig 2016-10-17 14:18:47 UTC
I stumbled upon this while looking into cpu flag support in libvirt.

I think there might be a typo in src/cpu/cpu_map.xml:
It contains <feature name='pclmuldq'/>
but the CPU features is actually called pclmulqdq (extra q).
https://en.wikipedia.org/wiki/CLMUL_instruction_set

Different files contain both spellings:

$ grep -irl pclmuldq
src/cpu/cpu_map.xml
tests/cputestdata/x86-cpuid-Xeon-E7-4820-host.xml
tests/cputestdata/x86-baseline-5-expanded.xml
tests/cputestdata/x86-baseline-6.xml
tests/cputestdata/x86-baseline-4.xml
tests/cputestdata/x86-baseline-5.xml
tests/cputestdata/x86-baseline-4-result.xml
tests/cputestdata/x86-baseline-4-expanded.xml
tests/capabilityschemadata/caps-test3.xml

$ grep -irl pclmulqdq libvirt/
libvirt/tests/virhostcpudata/linux-x86_64-test4.cpuinfo
libvirt/tests/virhostcpudata/linux-x86_64-test6.cpuinfo
libvirt/tests/virhostcpudata/linux-x86_64-test8.cpuinfo


In src/cpu/cpu_map.xml we have:
    <feature name='pclmuldq'>
      <cpuid eax_in='0x01' ecx='0x00000002'/>
    </feature>

So it seems to be used correctly, fixing it might cause minor breakage, because specifying cpu flags via commandline with virt-install would now require to use the correct spelling.

Unfortunately I don't have time to dig into this.

It was just really confusing when I was checking for those cpu features, and couldn't grep pclmuldq /proc/cpuinfo, but already had dozens of VMs running with "model name='SandyBridge'" which would require that feature.

Comment 1 Jiri Denemark 2016-10-17 14:50:07 UTC
Yes, the CPU feature is spelled incorrectly, but unfortunately we can't do much about it to keep backward compatibility. We could possibly at a comment to cpu_map.xml with the correct spelling, but I think that's about it.

Comment 2 Craig 2016-10-17 15:31:41 UTC
This was extremely confusing, so I think you should at least go for the comment...

Comment 3 Jiri Denemark 2016-11-30 13:40:15 UTC
commit 4d8d7c02d7cf3c8ba5632d913ebf06deb9f531b9
Refs: v2.5.0-rc1-11-g4d8d7c02d
Author:     Jiri Denemark <jdenemar>
AuthorDate: Tue Nov 29 20:39:13 2016 +0100
Commit:     Jiri Denemark <jdenemar>
CommitDate: Wed Nov 30 14:19:40 2016 +0100

    cpu: Add alternative feature spellings to CPU map

    We can't change feature names for compatibility reasons even if they
    contain typos or other software uses different names for the same
    features. By adding alternative spellings in our CPU map we at least
    allow anyone to grep for them and find the correct libvirt's name.

    Signed-off-by: Jiri Denemark <jdenemar>