All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yinghai Lu <yinghai@kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: relocs is only used with 32bit
Date: Fri, 13 Mar 2009 15:29:39 -0700	[thread overview]
Message-ID: <m1mybpt5t8.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <49B88F80.3080203@zytor.com> (H. Peter Anvin's message of "Wed\, 11 Mar 2009 21\:28\:48 -0700")

"H. Peter Anvin" <hpa@zytor.com> writes:

> Hi Yinghai,
>
> In general I prefer minimizing the conditional sections rather than
> maximizing them.  If nothing else, it catches errors earlier that way,
> and makes it easier to eventually eliminate them entirely.

Makes sense.  Although in this case that rule appears like it
can't even execute on x86_64.

The architectural differences result in different tradeoffs so the
relocation design is completely different on x86_64 and x86_32.

On x86_64 we just change the underlying page tables to point
at different physical addresses and have a fixed virtual address.
Since x86_64 is best with short (< 2GB) offsets that is a fairly
optimal.

On x86_32 where address space is precious and it doesn't really
matter where the kernel lives we take a 5% or so size penalty
to hold relocations in the binary and update the kernel at boot
time so everything assumes we run at the loaded address.

With the result that we need a link time helper on x86_32 and
not on x86_64.

Eric


  reply	other threads:[~2009-03-13 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 19:22 [PATCH] x86: relocs is only used with 32bit Yinghai Lu
2009-03-12  4:28 ` H. Peter Anvin
2009-03-13 22:29   ` Eric W. Biederman [this message]
2009-03-13 23:31     ` H. Peter Anvin

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=m1mybpt5t8.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=hpa@zytor.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.