Skip to contentSkip to conversation

hvm's cpuid config fix

PATCH New Jean Guyader 1 participant 1 message Apr 30, 2008 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hvm's cpuid config fix

Hi,

This patch fix some problem with the hvm's cpuid configuration.

- 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.

Signature · 1 line
Jean Guyader
tools/libxc/xc_cpuid_x86.c +3 -0
diff -r 483d006cc607 tools/libxc/xc_cpuid_x86.c
@@ -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();
 
tools/python/xen/lowlevel/xc/xc.c +1 -1
diff -r 483d006cc607 tools/python/xen/lowlevel/xc/xc.c
@@ -696,7 +696,7 @@ static PyObject *pyxc_dom_set_cpuid(XcOb
     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;
 
tools/python/xen/xm/create.py +3 -1
diff -r 483d006cc607 tools/python/xen/xm/create.py
@@ -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']

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