]> xenbits.xensource.com Git - xen.git/commitdiff
x86 hvm cpuid: fix some problem with the hvm's cpuid configuration.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 1 May 2008 15:08:36 +0000 (16:08 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 1 May 2008 15:08:36 +0000 (16:08 +0100)
  - When we overwrite a cpuid's input, apply the default policy
    for the other registers.
  - For the python binding, get unsigned long instead long.
  - Fix the multiple inputs cpuid's configuration parsing.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
tools/libxc/xc_cpuid_x86.c
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/xm/create.py

index f59618236ed637414289f218874737100438b0a7..2317b4d38d321f89ea61560f04208b72d4c34aa2 100644 (file)
@@ -385,7 +385,10 @@ int xc_cpuid_set(
     for ( i = 0; i < 4; i++ )
     {
         if ( config[i] == NULL )
+        {
+            regs[i] = polregs[i];
             continue;
+        }
         
         config_transformed[i] = alloc_str();
 
index 709bbba62bfc73c3887c518a0ab2a7c9777a5ba7..136634a59bbcebe32fc5e5c6c6d23aad59bf7e7e 100644 (file)
@@ -696,7 +696,7 @@ static PyObject *pyxc_dom_set_cpuid(XcObject *self,
     unsigned int input[2];
     char *regs[4], *regs_transform[4];
 
-    if ( !PyArg_ParseTuple(args, "iiOO", &domid,
+    if ( !PyArg_ParseTuple(args, "IIOO", &domid,
                            &input[0], &sub_input, &config) )
         return NULL;
 
index 7dc83f59b37124825be2fe72476ec51c7d501ad8..6c1b5c049cbb89fd43b444d306ad4ee2d1a7add3 100644 (file)
@@ -856,7 +856,9 @@ def preprocess_cpuid(vals, attr_name):
     if not vals.cpuid: return
     cpuid = {} 
     for cpuid_input in getattr(vals, attr_name):
-        cpuid_match = re.match(r"(?P<input>(0x)?[0-9A-Fa-f]+):(?P<regs>.*)", cpuid_input)
+        input_re = "(0x)?[0-9A-Fa-f]+(,(0x)?[0-9A-Fa-f]+)?"
+        cpuid_match = re.match(r'(?P<input>%s):(?P<regs>.*)' % \
+                               input_re, cpuid_input)
         if cpuid_match != None:
             res_cpuid = cpuid_match.groupdict()
             input = res_cpuid['input']