[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] A little bug in function generic_identify


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
  • Date: Tue, 4 Dec 2007 17:08:13 +0800
  • Delivery-date: Tue, 04 Dec 2007 01:09:07 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acg2VTNI09RuFgLNQnaDSN18f+ESqg==
  • Thread-topic: A little bug in function generic_identify

Hi,

When reading CPU model info in xen, I get wrong model information.
My cpu is family_6_model_23, while in xen I get family_6_model_7.
There is a little bug in function generic_identify. Intel's SDM 2A says,
when family is 6 or 15, extended model ID should be taken into
account. However, in this function, only family 15 is handled.

Is it proper to fix the bug by applying the following patch?

diff -r 32a7dc3b083b xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c Tue Dec 04 21:35:56 2007 +0800
+++ b/xen/arch/x86/cpu/common.c Wed Dec 05 00:43:07 2007 +0800
@@ -255,10 +255,10 @@ void __devinit generic_identify(struct c
            c->x86_capability[4] = excap;
            c->x86 = (tfms >> 8) & 15;
            c->x86_model = (tfms >> 4) & 15;
-           if (c->x86 == 0xf) {
+           if (c->x86 == 0xf)
                c->x86 += (tfms >> 20) & 0xff;
+            if (c->x86 >= 0x6)
                c->x86_model += ((tfms >> 16) & 0xF) << 4;
-           }
            c->x86_mask = tfms & 15;
            if ( cpu_has(c, X86_FEATURE_CLFLSH) )
                c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;

Best Regards
Haitao Shan

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.