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-changelog

[Xen-changelog] [xen-unstable] [XEN][POWERPC] get cpu_*_maps correct so

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN][POWERPC] get cpu_*_maps correct so physinfo and affinity is accurate
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Feb 2007 15:00:17 -0800
Delivery-date: Wed, 14 Feb 2007 15:00:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Date 1166377210 18000
# Node ID d1f053ff43d2a82ba68a0b7551b1076d694f673c
# Parent  60515808f591a211e3abd536b5b026e500ad3292
[XEN][POWERPC] get cpu_*_maps correct so physinfo and affinity is accurate
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/arch/powerpc/powerpc64/ppc970.c |    7 ++++++-
 xen/arch/powerpc/setup.c            |   19 +++++++++++++------
 xen/arch/powerpc/sysctl.c           |   10 +++++++---
 xen/include/asm-powerpc/processor.h |    1 +
 4 files changed, 27 insertions(+), 10 deletions(-)

diff -r 60515808f591 -r d1f053ff43d2 xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c       Sun Dec 17 12:36:31 2006 -0500
+++ b/xen/arch/powerpc/powerpc64/ppc970.c       Sun Dec 17 12:40:10 2006 -0500
@@ -129,7 +129,6 @@ unsigned int cpu_extent_order(void)
     return log_large_page_sizes[0] - PAGE_SHIFT;
 }
 
-
 /* This is more a platform thing than a CPU thing, but we only have
  * one platform now */
 int cpu_io_mfn(ulong mfn)
@@ -141,6 +140,12 @@ int cpu_io_mfn(ulong mfn)
 
     return 0;
 }
+
+int cpu_threads(int cpuid)
+{
+    return 1;
+}
+
 
 static u64 cpu0_hids[6];
 static u64 cpu0_hior;
diff -r 60515808f591 -r d1f053ff43d2 xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Sun Dec 17 12:36:31 2006 -0500
+++ b/xen/arch/powerpc/setup.c  Sun Dec 17 12:40:10 2006 -0500
@@ -179,9 +179,6 @@ static void __init start_of_day(void)
     set_current(idle_domain->vcpu[0]);
     idle_vcpu[0] = current;
 
-    /* for some reason we need to set our own bit in the thread map */
-    cpu_set(0, cpu_sibling_map[0]);
-
     initialize_keytable();
     /* Register another key that will allow for the the Harware Probe
      * to be contacted, this works with RiscWatch probes and should
@@ -247,6 +244,19 @@ static int kick_secondary_cpus(int maxcp
     int cpuid;
 
     for_each_present_cpu(cpuid) {
+        int threads;
+        int i;
+        
+        threads = cpu_threads(cpuid);
+        for (i = 0; i < threads; i++)
+            cpu_set(i, cpu_sibling_map[cpuid]);
+
+        /* For now everything is single core */
+        cpu_set(0, cpu_core_map[cpuid]);
+
+        numa_set_node(cpuid, 0);
+        numa_add_cpu(cpuid);
+
         if (cpuid == 0)
             continue;
         if (cpuid >= maxcpus)
@@ -257,9 +267,6 @@ static int kick_secondary_cpus(int maxcp
         /* wait for it */
         while (!cpu_online(cpuid))
             cpu_relax();
-
-        numa_set_node(cpuid, 0);
-        numa_add_cpu(cpuid);
     }
 
     return 0;
diff -r 60515808f591 -r d1f053ff43d2 xen/arch/powerpc/sysctl.c
--- a/xen/arch/powerpc/sysctl.c Sun Dec 17 12:36:31 2006 -0500
+++ b/xen/arch/powerpc/sysctl.c Sun Dec 17 12:40:10 2006 -0500
@@ -41,9 +41,13 @@ long arch_do_sysctl(struct xen_sysctl *s
     {
         xen_sysctl_physinfo_t *pi = &sysctl->u.physinfo;
 
-        pi->threads_per_core = 1;
-        pi->cores_per_socket = 1;
-        pi->sockets_per_node = 1;
+        pi->threads_per_core =
+            cpus_weight(cpu_sibling_map[0]);
+        pi->cores_per_socket =
+            cpus_weight(cpu_core_map[0]) / pi->threads_per_core;
+        pi->sockets_per_node = 
+            num_online_cpus() / cpus_weight(cpu_core_map[0]);
+
         pi->nr_nodes         = 1;
         pi->total_pages      = total_pages;
         pi->free_pages       = avail_domheap_pages();
diff -r 60515808f591 -r d1f053ff43d2 xen/include/asm-powerpc/processor.h
--- a/xen/include/asm-powerpc/processor.h       Sun Dec 17 12:36:31 2006 -0500
+++ b/xen/include/asm-powerpc/processor.h       Sun Dec 17 12:40:10 2006 -0500
@@ -125,6 +125,7 @@ extern void cpu_initialize(int cpuid);
 extern void cpu_initialize(int cpuid);
 extern void cpu_init_vcpu(struct vcpu *);
 extern int cpu_io_mfn(ulong mfn);
+extern int cpu_threads(int cpuid);
 extern void save_cpu_sprs(struct vcpu *);
 extern void load_cpu_sprs(struct vcpu *);
 extern void flush_segments(void);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN][POWERPC] get cpu_*_maps correct so physinfo and affinity is accurate, Xen patchbot-unstable <=