All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Scott Parish" <srparish@us.ibm.com>
To: xen-devel@lists.xensource.com
Subject: [patch] cpuid size for x86_64
Date: Tue, 31 May 2005 19:27:13 +0000	[thread overview]
Message-ID: <20050531192712.GE9951@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

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

[-- Attachment #2: cpuid.diff --]
[-- Type: text/plain, Size: 1727 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2005-05-31 19:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050531192712.GE9951@us.ibm.com \
    --to=srparish@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.