public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH] x86: put initial_pg_tables into bss -v2
Date: Sun, 01 Mar 2009 15:29:32 -0800	[thread overview]
Message-ID: <49AB1A5C.6040300@zytor.com> (raw)
In-Reply-To: <49AACEB3.5050206@kernel.org>

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.

	-hpa

  reply	other threads:[~2009-03-01 23:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28  1:51 [PATCH] Simple brk allocator for very early allocations Jeremy Fitzhardinge
2009-02-28  1:51 ` [PATCH] x86: add brk allocation for very, " Jeremy Fitzhardinge
2009-02-28  1:51 ` [PATCH] x86: reserve brk earlier Jeremy Fitzhardinge
2009-02-28  1:51 ` [PATCH] x86-32: use brk segment for allocating initial kernel pagetable Jeremy Fitzhardinge
2009-02-28  7:02   ` Yinghai Lu
2009-02-28  7:05     ` J Jeremy Fitzhardinge
2009-02-28  7:15       ` J Ingo Molnar
2009-02-28  7:39         ` does boot loader check uncompressed kernel size? Yinghai Lu
2009-02-28  7:47           ` Cyrill Gorcunov
2009-02-28  7:54             ` Yinghai Lu
2009-02-28  8:08               ` H. Peter Anvin
2009-02-28 20:42                 ` Yinghai Lu
2009-02-28  7:52           ` brk patches Yinghai Lu
2009-02-28  8:08             ` H. Peter Anvin
2009-02-28  8:17             ` Jeremy Fitzhardinge
2009-02-28 20:40               ` Yinghai Lu
2009-03-01 23:53                 ` Jeremy Fitzhardinge
2009-03-02  1:02                   ` Yinghai Lu
2009-03-02  1:07                     ` H. Peter Anvin
2009-03-02  1:16                       ` Jeremy Fitzhardinge
2009-03-02  1:36                         ` H. Peter Anvin
2009-03-02  1:54                           ` Jeremy Fitzhardinge
2009-03-02  2:12                             ` Yinghai Lu
2009-03-01  1:23               ` [PATCH] x86: put initial_pg_tables into bss Yinghai Lu
2009-03-01  8:31                 ` [PATCH] x86: put initial_pg_tables into bss -v2 Yinghai Lu
2009-03-01  9:20                   ` H. Peter Anvin
2009-03-01 17:49                     ` Yinghai Lu
2009-03-01 18:06                     ` Yinghai Lu
2009-03-01 23:29                       ` H. Peter Anvin [this message]
2009-03-02  0:55                         ` Yinghai Lu
2009-03-09  8:15                           ` [PATCH] x86: put initial_pg_tables into .bss -v4 Yinghai Lu
2009-03-09 15:41                             ` H. Peter Anvin
2009-03-09 17:35                               ` Yinghai Lu
2009-03-09 18:28                                 ` H. Peter Anvin
2009-03-11  1:39                                   ` Jeremy Fitzhardinge
2009-03-09  7:45                         ` [PATCH] x86: put initial_pg_tables into bss -v2 Yinghai Lu
2009-02-28  8:07           ` does boot loader check uncompressed kernel size? H. Peter Anvin
2009-02-28  8:17         ` J Jeremy Fitzhardinge
2009-02-28  7:30       ` J Yinghai Lu
2009-02-28  1:51 ` [PATCH] x86: use brk allocation for DMI Jeremy Fitzhardinge
2009-02-28  1:51 ` [PATCH] x86: leave _brk_end defined Jeremy Fitzhardinge
2009-02-28  5:23 ` [PATCH] Simple brk allocator for very early allocations Andrew Morton
2009-02-28  6:30   ` Jeremy Fitzhardinge

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=49AB1A5C.6040300@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.org \
    /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