WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] A little bug in function generic_identify

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] A little bug in function generic_identify
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] A little bug in function generic_identify, Shan, Haitao <=