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] [PATCH] x86: fix cpu_sibling_map initialization when topolog

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: fix cpu_sibling_map initialization when topology CPUID leaf is present
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Mon, 14 Mar 2011 13:44:35 +0000
Cc: Weidong Han <weidong.han@xxxxxxxxx>
Delivery-date: Mon, 14 Mar 2011 06:44:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
c/s 21811:12f0618400de broke this by not properly initializing struct
cpuinfo_x86's x86_num_siblings member (other than Linux, where this is
a global variable, it is being maintained per CPU by Xen).

Hyper-threaded CPUs with CPUID leaf 0xb present had therefore all
cpu_sibling_map-s with just a single bit set, thus improperly feeding
the scheduler.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -477,7 +477,7 @@ void __cpuinit detect_extended_topology(
 {
        unsigned int eax, ebx, ecx, edx, sub_index;
        unsigned int ht_mask_width, core_plus_mask_width;
-       unsigned int core_select_mask, core_level_siblings, smp_num_siblings;
+       unsigned int core_select_mask, core_level_siblings;
        unsigned int initial_apicid;
        int cpu = smp_processor_id();
 
@@ -495,7 +495,7 @@ void __cpuinit detect_extended_topology(
        initial_apicid = edx;
 
        /* Populate HT related information from sub-leaf level 0 */
-       core_level_siblings = smp_num_siblings = LEVEL_MAX_SIBLINGS(ebx);
+       core_level_siblings = c->x86_num_siblings = LEVEL_MAX_SIBLINGS(ebx);
        core_plus_mask_width = ht_mask_width = BITS_SHIFT_NEXT_LEVEL(eax);
 
        sub_index = 1;
@@ -519,7 +519,7 @@ void __cpuinit detect_extended_topology(
        phys_proc_id[cpu] = phys_pkg_id(initial_apicid, core_plus_mask_width);
 
        c->apicid = phys_pkg_id(initial_apicid, 0);
-       c->x86_max_cores = (core_level_siblings / smp_num_siblings);
+       c->x86_max_cores = (core_level_siblings / c->x86_num_siblings);
 
        if ( opt_cpu_info )
        {



Attachment: x86-topology.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: fix cpu_sibling_map initialization when topology CPUID leaf is present, Jan Beulich <=