From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Guyader Subject: [PATCH] hvm's cpuid config fix Date: Wed, 30 Apr 2008 16:32:39 +0100 Message-ID: <48189117.5040100@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050802050104020104080807" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------050802050104020104080807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. Signed-off-by: Jean Guyader -- Jean Guyader --------------050802050104020104080807 Content-Type: text/x-diff; name="cpuid_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cpuid_fix.patch" diff -r 483d006cc607 tools/libxc/xc_cpuid_x86.c --- a/tools/libxc/xc_cpuid_x86.c Fri Apr 25 13:46:27 2008 +0100 +++ b/tools/libxc/xc_cpuid_x86.c Wed Apr 30 16:18:53 2008 +0100 @@ -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(); diff -r 483d006cc607 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Fri Apr 25 13:46:27 2008 +0100 +++ b/tools/python/xen/lowlevel/xc/xc.c Wed Apr 30 16:18:53 2008 +0100 @@ -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; diff -r 483d006cc607 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Fri Apr 25 13:46:27 2008 +0100 +++ b/tools/python/xen/xm/create.py Wed Apr 30 16:18:53 2008 +0100 @@ -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(0x)?[0-9A-Fa-f]+):(?P.*)", cpuid_input) + input_re = "(0x)?[0-9A-Fa-f]+(,(0x)?[0-9A-Fa-f]+)?" + cpuid_match = re.match(r'(?P%s):(?P.*)' % \ + input_re, cpuid_input) if cpuid_match != None: res_cpuid = cpuid_match.groupdict() input = res_cpuid['input'] --------------050802050104020104080807 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050802050104020104080807--