On Sun, 2006-09-24 at 23:25 -0700, Jeremy Fitzhardinge wrote: > Rusty Russell wrote: > > 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. > > > Hm, I guess, so long as you assume the kernel data segment is always > below the kernel heap. Agreed, we should BUG_ON() in case anyone ever changes this... I will create a patch for this... > > 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; > > > limit is a size, rather than the end address, so this isn't quite right. I think it's OK. For every "%gs:var", var will be less than __per_cpu_end. Thanks! Rusty. -- Help! Save Australia from the worst of the DMCA: http://linux.org.au/law - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH 0/7] Using %gs for per-cpu areas on x86
- From: Rusty Russell <[email protected]>
- [PATCH 1/7] Use per-cpu GDT tables from early in boot
- From: Rusty Russell <[email protected]>
- [PATCH 2/7]
- From: Rusty Russell <[email protected]>
- [PATCH 3/7] Update sys_vm86 to cope with changed pt_regs and %gs usage.
- From: Rusty Russell <[email protected]>
- [PATCH 4/7] Fix places where using %gs changes the usermode ABI.
- From: Rusty Russell <[email protected]>
- [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Rusty Russell <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Jeremy Fitzhardinge <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Rusty Russell <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Jeremy Fitzhardinge <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Rusty Russell <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Jeremy Fitzhardinge <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Rusty Russell <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Jeremy Fitzhardinge <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Rusty Russell <[email protected]>
- Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- From: Jeremy Fitzhardinge <[email protected]>
- [PATCH 0/7] Using %gs for per-cpu areas on x86
- Prev by Date: Re: When will the lunacy end? (Was Re: [PATCH] uswsusp: add pmops->{prepare,enter,finish} support (aka "platform mode"))
- Next by Date: Re: [PATCH] Linux Kernel Markers 0.11 for 2.6.17
- Previous by thread: Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- Next by thread: Re: [PATCH 5/7] Use %gs for per-cpu sections in kernel
- Index(es):