[lkml]   [2009]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: put initial_pg_tables into bss -v2
Yinghai Lu wrote:
>> No, this is garbage. If you're insisting on getting rid of the brk-like
>> allocation patterns,> YH
then you have to get an alternative dynamic
>> allocator available to the pre-paging code. Now, there is no reason we
>> couldn't execute C code before enabling paging, although the code would
>> either have to be PIC or linked at the physical address.
> you can use find_e820_area()/reserve_early() pair to find right position for that.

This stuff is currently done before paging is enabled, and existing C
code can't be run as-is. There are three ways to deal with that:

a) compile some of the code with -fPIC/-fPIE.
b) link some code twice with different offsets.
c) play really ugly games with segments (thus making the virtualization
guys unhappy.)

Pretty much, these options all suck. Another option, of course, is to
generate a fixed amount of page tables just to get us into the C
environment, generate a new set, *and reclaim the old ones*. That way
we're not wasting memory if we're on a small-RAM machine.

It's still really ugly, though. A much easier and cleaner way would
seem to be to calculate a far limit on the brk and then marking it as a
formal (non-alloc) section in the linker script and vmlinux file. That
way anything that examines the vmlinux file will see it as an exclusion
section. We can (and should) even verify that we don't overflow the brk
and panic if we do.


 \ /
  Last update: 2009-03-02 00:33    [W:0.085 / U:1.492 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site