public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Intel x86-64 support patch breaks amd64
@ 2004-02-19 18:34 Tony Lindgren
  2004-02-20 16:13 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: Tony Lindgren @ 2004-02-19 18:34 UTC (permalink / raw)
  To: ak; +Cc: linux-kernel

Hi Andi,

I guess you probably already know about this, but the recent changeset
1.1561.1.1 breaks compiling and booting for amd64.

First, this breaks for the compile:

arch/x86_64/kernel/setup.c: In function detect_ht':
arch/x86_64/kernel/setup.c:599: error: smp_num_siblings' undeclared (first
use in this function)
arch/x86_64/kernel/setup.c:599: error: (Each undeclared identifier is
reported only once
arch/x86_64/kernel/setup.c:599: error: for each function it appears in.)
make[1]: *** [arch/x86_64/kernel/setup.o] Error 1
make: *** [arch/x86_64/kernel] Error 2

After #if 0 out some parts to make it compile, it fails to boot with no
output at all. Sorry, don't have low level debugging or serial console on 
this machine configured, let me know if you need further information.

Undoing this cset makes things work as before.

Regards,

Tony

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Intel x86-64 support patch breaks amd64
@ 2004-02-19 20:45 Siddha, Suresh B
  2004-02-20 19:29 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: Siddha, Suresh B @ 2004-02-19 20:45 UTC (permalink / raw)
  To: Andi Kleen, Tony Lindgren; +Cc: linux-kernel

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

> > After #if 0 out some parts to make it compile, it fails to 
> boot with no
> > output at all. Sorry, don't have low level debugging or 
> serial console on 
> > this machine configured, let me know if you need further 
> information.
> 
> It works for me with this patch both UP and SMP. Maybe you 
> commented out 
> too much? 
> 
> -Andi

Andi, Appended patch should fix the problem reported by Tony.

thanks,
suresh

diff -Nru linux/arch/x86_64/kernel/head.S linux~/arch/x86_64/kernel/head.S
--- linux/arch/x86_64/kernel/head.S	2004-02-19 03:10:55.000000000 -0800
+++ linux~/arch/x86_64/kernel/head.S	2004-02-19 04:21:51.000000000 -0800
@@ -358,7 +358,7 @@
 	/* asm/segment.h:GDT_ENTRIES must match this */	
 	/* This should be a multiple of the cache line size */
 	/* GDTs of other CPUs: */	
-	.fill (L1_CACHE_BYTES * NR_CPUS) - (gdt_end - cpu_gdt_table) 
+	.fill (GDT_SIZE * NR_CPUS) - (gdt_end - cpu_gdt_table) 
 
 	.align  L1_CACHE_BYTES
 ENTRY(idt_table)	
diff -Nru linux/arch/x86_64/kernel/setup.c linux~/arch/x86_64/kernel/setup.c
--- linux/arch/x86_64/kernel/setup.c	2004-02-19 03:10:55.000000000 -0800
+++ linux~/arch/x86_64/kernel/setup.c	2004-02-19 03:18:58.000000000 -0800
@@ -586,6 +586,7 @@
 	return r;
 }
 
+#ifdef CONFIG_X86_HT
 static void __init detect_ht(void)
 {
 	extern	int phys_proc_id[NR_CPUS];
@@ -632,6 +633,7 @@
 		       phys_proc_id[cpu]);
 	}
 }
+#endif
 	
 #define LVL_1_INST	1
 #define LVL_1_DATA	2
@@ -761,8 +763,10 @@
 		c->x86_cache_size = l2 ? l2 : (l1i+l1d);
 	}
 
+#ifdef CONFIG_X86_HT
 	if (cpu_has(c, X86_FEATURE_HT))
 		detect_ht(); 
+#endif
 
 	n = cpuid_eax(0x80000000);
 	if (n >= 0x80000008) {
diff -Nru linux/arch/x86_64/kernel/x8664_ksyms.c linux~/arch/x86_64/kernel/x8664_ksyms.c
--- linux/arch/x86_64/kernel/x8664_ksyms.c	2004-02-19 03:10:55.000000000 -0800
+++ linux~/arch/x86_64/kernel/x8664_ksyms.c	2004-02-19 03:20:04.000000000 -0800
@@ -194,7 +194,10 @@
 
 EXPORT_SYMBOL(die_chain);
 
+#ifdef CONFIG_X86_HT
+EXPORT_SYMBOL(smp_num_siblings);
 EXPORT_SYMBOL(cpu_sibling_map);
+#endif
 
 extern void do_softirq_thunk(void);
 EXPORT_SYMBOL_NOVERS(do_softirq_thunk);
diff -Nru linux/include/asm-x86_64/segment.h linux~/include/asm-x86_64/segment.h
--- linux/include/asm-x86_64/segment.h	2004-02-19 03:11:05.000000000 -0800
+++ linux~/include/asm-x86_64/segment.h	2004-02-19 04:21:17.000000000 -0800
@@ -40,7 +40,7 @@
 #define FS_TLS_SEL ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3)
 
 #define IDT_ENTRIES 256
-#define GDT_ENTRIES (L1_CACHE_BYTES / 8) 
+#define GDT_ENTRIES 16
 #define GDT_SIZE (GDT_ENTRIES * 8)
 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) 
 

[-- Attachment #2: gdt+ht-fix.patch --]
[-- Type: application/octet-stream, Size: 2184 bytes --]

diff -Nru linux/arch/x86_64/kernel/head.S linux~/arch/x86_64/kernel/head.S
--- linux/arch/x86_64/kernel/head.S	2004-02-19 03:10:55.000000000 -0800
+++ linux~/arch/x86_64/kernel/head.S	2004-02-19 04:21:51.000000000 -0800
@@ -358,7 +358,7 @@
 	/* asm/segment.h:GDT_ENTRIES must match this */	
 	/* This should be a multiple of the cache line size */
 	/* GDTs of other CPUs: */	
-	.fill (L1_CACHE_BYTES * NR_CPUS) - (gdt_end - cpu_gdt_table) 
+	.fill (GDT_SIZE * NR_CPUS) - (gdt_end - cpu_gdt_table) 
 
 	.align  L1_CACHE_BYTES
 ENTRY(idt_table)	
diff -Nru linux/arch/x86_64/kernel/setup.c linux~/arch/x86_64/kernel/setup.c
--- linux/arch/x86_64/kernel/setup.c	2004-02-19 03:10:55.000000000 -0800
+++ linux~/arch/x86_64/kernel/setup.c	2004-02-19 03:18:58.000000000 -0800
@@ -586,6 +586,7 @@
 	return r;
 }
 
+#ifdef CONFIG_X86_HT
 static void __init detect_ht(void)
 {
 	extern	int phys_proc_id[NR_CPUS];
@@ -632,6 +633,7 @@
 		       phys_proc_id[cpu]);
 	}
 }
+#endif
 	
 #define LVL_1_INST	1
 #define LVL_1_DATA	2
@@ -761,8 +763,10 @@
 		c->x86_cache_size = l2 ? l2 : (l1i+l1d);
 	}
 
+#ifdef CONFIG_X86_HT
 	if (cpu_has(c, X86_FEATURE_HT))
 		detect_ht(); 
+#endif
 
 	n = cpuid_eax(0x80000000);
 	if (n >= 0x80000008) {
diff -Nru linux/arch/x86_64/kernel/x8664_ksyms.c linux~/arch/x86_64/kernel/x8664_ksyms.c
--- linux/arch/x86_64/kernel/x8664_ksyms.c	2004-02-19 03:10:55.000000000 -0800
+++ linux~/arch/x86_64/kernel/x8664_ksyms.c	2004-02-19 03:20:04.000000000 -0800
@@ -194,7 +194,10 @@
 
 EXPORT_SYMBOL(die_chain);
 
+#ifdef CONFIG_X86_HT
+EXPORT_SYMBOL(smp_num_siblings);
 EXPORT_SYMBOL(cpu_sibling_map);
+#endif
 
 extern void do_softirq_thunk(void);
 EXPORT_SYMBOL_NOVERS(do_softirq_thunk);
diff -Nru linux/include/asm-x86_64/segment.h linux~/include/asm-x86_64/segment.h
--- linux/include/asm-x86_64/segment.h	2004-02-19 03:11:05.000000000 -0800
+++ linux~/include/asm-x86_64/segment.h	2004-02-19 04:21:17.000000000 -0800
@@ -40,7 +40,7 @@
 #define FS_TLS_SEL ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3)
 
 #define IDT_ENTRIES 256
-#define GDT_ENTRIES (L1_CACHE_BYTES / 8) 
+#define GDT_ENTRIES 16
 #define GDT_SIZE (GDT_ENTRIES * 8)
 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) 
 

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: Intel x86-64 support patch breaks amd64
@ 2004-02-19 21:14 Siddha, Suresh B
  2004-02-20 20:12 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: Siddha, Suresh B @ 2004-02-19 21:14 UTC (permalink / raw)
  To: Andi Kleen; +Cc: tony, linux-kernel

> 
> Which change exactly is supposed to fix it? And why? 
> 
> For me the UP kernel boots just fine.
> 
> -Andi

GDT changes that I sent, fixes the boot problem. Its broken with CONFIG_X86_L1_CACHE_BYTES=64.

thanks,
suresh

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-02-19 21:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 18:34 Intel x86-64 support patch breaks amd64 Tony Lindgren
2004-02-20 16:13 ` Andi Kleen
2004-02-19 19:36   ` Jakub Jelinek
2004-02-20 16:44     ` Andi Kleen
2004-02-19 21:20       ` Philippe Elie
2004-02-20 19:32         ` [PATCH] Fix typo in x86-64 fix Andi Kleen
2004-02-19 20:39   ` Intel x86-64 support patch breaks amd64 Tony Lindgren
2004-02-20 19:02     ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2004-02-19 20:45 Siddha, Suresh B
2004-02-20 19:29 ` Andi Kleen
2004-02-19 21:14   ` Tony Lindgren
2004-02-19 21:14 Siddha, Suresh B
2004-02-20 20:12 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox