Skip to contentSkip to conversation

tools: Check the length of cpuid inputs

PATCH New Jean Guyader 1 participant 1 message Jul 21, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: Check the length of cpuid inputs

tools: cpuid inputs must be 32 character long if hexadecimal value is not used.

Signature · 1 line
Jean Guyader
tools/python/xen/xm/create.py +4 -0
diff -r 63317b6c3eab tools/python/xen/xm/create.py
@@ -955,6 +960,10 @@ def preprocess_cpuid(vals, attr_name):
                 if reg_match == None:
                     err("cpuid's syntax is (eax|ebx|ecx|edx)=value")
                 res = reg_match.groupdict()
+                if (res['val'][:2] != '0x' and len(res['val']) != 32):
+                    err("cpuid: We should specify all the bits " \
+                        "of the register %s for input %s\n"
+                        % (res['reg'], input) )
                 cpuid[input][res['reg']] = res['val'] # new register
     setattr(vals, attr_name, cpuid)
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel