]> xenbits.xensource.com Git - xen.git/commit
x86/cpu: Introduce x86_cpuid_vendor_to_str() and drop cpu_dev.c_vendor[]
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Apr 2019 18:19:20 +0000 (19:19 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Apr 2019 10:09:08 +0000 (11:09 +0100)
commitf2f8c67ed9e5ec2c61c8d70653cc35d5427efe82
tree72c9b6f6ac09032655e25bf9b28567b951231b1d
parent64933920c9b34129d8c868347da0ed396b50e3a8
x86/cpu: Introduce x86_cpuid_vendor_to_str() and drop cpu_dev.c_vendor[]

cpu_dev.c_vendor[] is a char[8] array which is printed using %s in two
locations.  This leads to subtle lack-of-NUL bugs when using an 8 character
vendor name.

Introduce x86_cpuid_vendor_to_str() to turn an x86_vendor into a printable
string, use it in the two locations that c_vendor is used, and drop c_vendor.

This drops the final user of X86_VENDOR_NUM, so drop that as well.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/amd.c
xen/arch/x86/cpu/centaur.c
xen/arch/x86/cpu/common.c
xen/arch/x86/cpu/cpu.h
xen/arch/x86/cpu/intel.c
xen/arch/x86/cpu/shanghai.c
xen/include/asm-x86/x86-vendors.h
xen/include/xen/lib/x86/cpuid.h
xen/lib/x86/cpuid.c