xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] linux/x86-64: adjustments to match i386 behavior
Date: Thu, 30 Sep 2010 14:33:05 +0100	[thread overview]
Message-ID: <4CA4ADB10200007800019C87@vpn.id2.novell.com> (raw)

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

On i386 the corresponding code is inside X86_HT conditionals, and this
config variable is unconditionally off for X86_XEN.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/arch/x86_64/kernel/setup-xen.c
+++ b/arch/x86_64/kernel/setup-xen.c
@@ -1048,7 +1048,7 @@ static int nearby_node(int apicid)
  */
 static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	unsigned bits;
 #ifdef CONFIG_NUMA
 	int cpu = smp_processor_id();
@@ -1162,7 +1162,7 @@ static void __init init_amd(struct cpuin
 
 static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	u32 	eax, ebx, ecx, edx;
 	int 	index_msb, core_bits;
 
@@ -1347,7 +1347,7 @@ void __cpuinit early_identify_cpu(struct
 		c->x86 = 4;
 	}
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
 #endif
 }
@@ -1555,7 +1555,7 @@ static int show_cpuinfo(struct seq_file 
 	if (c->x86_cache_size >= 0) 
 		seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 	
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	if (smp_num_siblings * c->x86_max_cores > 1) {
 		int cpu = c - cpu_data;
 		seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -54,7 +54,7 @@ extern int __node_distance(int, int);
 
 #endif
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 #define topology_physical_package_id(cpu)	(cpu_data[cpu].phys_proc_id)
 #define topology_core_id(cpu)			(cpu_data[cpu].cpu_core_id)
 #define topology_core_siblings(cpu)		(cpu_core_map[cpu])




[-- Attachment #2: xen-x86_64-no-topology.patch --]
[-- Type: text/plain, Size: 1784 bytes --]

On i386 the corresponding code is inside X86_HT conditionals, and this
config variable is unconditionally off for X86_XEN.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/arch/x86_64/kernel/setup-xen.c
+++ b/arch/x86_64/kernel/setup-xen.c
@@ -1048,7 +1048,7 @@ static int nearby_node(int apicid)
  */
 static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	unsigned bits;
 #ifdef CONFIG_NUMA
 	int cpu = smp_processor_id();
@@ -1162,7 +1162,7 @@ static void __init init_amd(struct cpuin
 
 static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	u32 	eax, ebx, ecx, edx;
 	int 	index_msb, core_bits;
 
@@ -1347,7 +1347,7 @@ void __cpuinit early_identify_cpu(struct
 		c->x86 = 4;
 	}
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
 #endif
 }
@@ -1555,7 +1555,7 @@ static int show_cpuinfo(struct seq_file 
 	if (c->x86_cache_size >= 0) 
 		seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 	
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 	if (smp_num_siblings * c->x86_max_cores > 1) {
 		int cpu = c - cpu_data;
 		seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -54,7 +54,7 @@ extern int __node_distance(int, int);
 
 #endif
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
 #define topology_physical_package_id(cpu)	(cpu_data[cpu].phys_proc_id)
 #define topology_core_id(cpu)			(cpu_data[cpu].cpu_core_id)
 #define topology_core_siblings(cpu)		(cpu_core_map[cpu])

[-- 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:[~2010-09-30 13:33 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=4CA4ADB10200007800019C87@vpn.id2.novell.com \
    --to=jbeulich@novell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).