From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Scott Parish" Subject: [patch] cpuid size for x86_64 Date: Tue, 31 May 2005 19:27:13 +0000 Message-ID: <20050531192712.GE9951@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0lnxQi9hkpPO77W3" Return-path: Content-Disposition: inline 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 --0lnxQi9hkpPO77W3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline As far as i can tell, cpuid only ever uses the first 32 bits for result flags. In any case, x86_capability was defined as a long, but constant_test_bit() was typecasting to an int before doing an array dereference, so other then x86_capability[0] we were looking at the wrong bits. (noticed when NX was not being detected) sRp -- Scott Parish Signed-off-by: srparish@us.ibm.com --0lnxQi9hkpPO77W3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cpuid.diff" diff -rN -u -p old-xen-64-4/xen/arch/x86/cpu/common.c new-xen-64-4/xen/arch/x86/cpu/common.c --- old-xen-64-4/xen/arch/x86/cpu/common.c 2005-05-31 16:15:06.000000000 +0000 +++ new-xen-64-4/xen/arch/x86/cpu/common.c 2005-05-31 19:06:17.000000000 +0000 @@ -331,7 +331,7 @@ void __init identify_cpu(struct cpuinfo_ #ifdef NOISY_CAPS printk(KERN_DEBUG "CPU: After generic identify, caps:"); for (i = 0; i < NCAPINTS; i++) - printk(" %08lx", c->x86_capability[i]); + printk(" %08x", c->x86_capability[i]); printk("\n"); #endif @@ -340,7 +340,7 @@ void __init identify_cpu(struct cpuinfo_ #ifdef NOISY_CAPS printk(KERN_DEBUG "CPU: After vendor identify, caps:"); for (i = 0; i < NCAPINTS; i++) - printk(" %08lx", c->x86_capability[i]); + printk(" %08x", c->x86_capability[i]); printk("\n"); #endif } @@ -395,7 +395,7 @@ void __init identify_cpu(struct cpuinfo_ #ifdef NOISY_CAPS printk(KERN_DEBUG "CPU: After all inits, caps:"); for (i = 0; i < NCAPINTS; i++) - printk(" %08lx", c->x86_capability[i]); + printk(" %08x", c->x86_capability[i]); printk("\n"); #endif /* diff -rN -u -p old-xen-64-4/xen/include/asm-x86/processor.h new-xen-64-4/xen/include/asm-x86/processor.h --- old-xen-64-4/xen/include/asm-x86/processor.h 2005-05-31 16:15:06.000000000 +0000 +++ new-xen-64-4/xen/include/asm-x86/processor.h 2005-05-31 19:03:35.000000000 +0000 @@ -155,7 +155,7 @@ struct cpuinfo_x86 { char hard_math; char rfu; int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ - unsigned long x86_capability[NCAPINTS]; + unsigned int x86_capability[NCAPINTS]; char x86_vendor_id[16]; char x86_model_id[64]; int x86_cache_size; /* in KB - valid for CPUS which support this --0lnxQi9hkpPO77W3 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 --0lnxQi9hkpPO77W3--