Thread (32 messages) 32 messages, 3 authors, 2006-09-25

Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel

From: Rusty Russell <hidden>
Date: 2006-09-25 06:03:56
Also in: lkml

On Sun, 2006-09-24 at 22:25 -0700, Jeremy Fitzhardinge wrote:
The %gs:per_cpu__foo addressing mode still calculates 
0xbcef00+0xc0433800, which is still a subtraction.  My essential point 
is that *all* kernel addresses (=kernel symbols) are negative, so using 
them as an offset from a segment base (any segment base) is a 
subtraction, which requires a 4G limit.
I don't think so.  There's *never* address subtraction, there's
sometimes 32 bit wrap (glibc uses this to effect subtraction, sure).
But there's no wrap here.

To test, I changed the following:
--- smpboot.c.~8~	2006-09-25 15:51:50.000000000 +1000
+++ smpboot.c	2006-09-25 16:00:36.000000000 +1000
@@ -926,8 +926,9 @@
 					      unsigned long per_cpu_off)
 {
 	unsigned limit, flags;
+	extern char __per_cpu_end[];
 
-	limit = (1 << 20);
+	limit = PAGE_ALIGN((long)__per_cpu_end) >> PAGE_SHIFT;
 	flags = 0x8;		/* 4k granularity */
 
 	/* present read-write data segment */

Works fine...

Hope that clarifies!
Rusty.
-- 
Help! Save Australia from the worst of the DMCA: http://linux.org.au/law
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help