Skip to contentSkip to conversation

cpuid size for x86_64

PATCH New Scott Parish 1 participant 1 message May 31, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuid size for x86_64

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

Signature · 2 lines
Scott Parish
Signed-off-by: [email protected]
xen/arch/x86/cpu/common.c +3 -3
diff -rN -u -p old-xen-64-4/xen/arch/x86/cpu/common.c new-xen-64-4/xen/arch/x86/cpu/common.c
@@ -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
 	/*
xen/include/asm-x86/processor.h +1 -1
diff -rN -u -p old-xen-64-4/xen/include/asm-x86/processor.h new-xen-64-4/xen/include/asm-x86/processor.h
@@ -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

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