public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Magnus Damm" <magnus.damm@gmail.com>
Cc: vgoyal@in.ibm.com, "Magnus Damm" <magnus@valinux.co.jp>,
	fastboot@lists.osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [Fastboot] [PATCH] kexec: Avoid overwriting the current pgd (i386)
Date: Tue, 02 May 2006 01:15:23 -0600	[thread overview]
Message-ID: <m17j54aodw.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <aec7e5c30605011856v5023b8fdwf8542c746a8a09dd@mail.gmail.com> (Magnus Damm's message of "Tue, 2 May 2006 10:56:09 +0900")

"Magnus Damm" <magnus.damm@gmail.com> writes:

> On 5/2/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
>>
>> Well global variables don't quite work in the normal case.
>>
>> However it probably makes most sense to maintain the needed variables
>> in a structure on the control page.  Which will keep them out of harms way,
>> and won't require patches to the generic code.
>
> I agree with both of you that the #ifdefs in struct kimage should be
> avoided, but I wonder if adding variables in a structure on the
> control page is the easiest and cleanest way.
>
> I think that defining a structure for each architecture in
> include/asm/kexec.h that is included in struct kimage is the best way
> to go. Then each architecture can have whatever data it wants there,
> and we both avoid #ifdefs in struct kimage _and_ we stay away from
> overly complicated code that just allocates, frees and parses
> architecture-dependent data.

Well I think it would be fairly simple to have a structure:
struct control_page {
       type	variabe;
       ...
       code[0];	
};

Or something like that we can work with.

The big reason for doing this is that I believe control pages
have additional protection that struct kimage does, being allocated
in areas where the kernel never sets up DMA transfers.  Possibly
that needs to be fixed, but this is something we need to be very
careful with.

For a page table all we need to store is the physical address of the
first page.  Storing and working with a struct page entry is the wrong
thing to do.  I would prefer to stomp the kernel data structures than
to add an extra dependencies on the original panic'd kernel.  At first
glance I am afraid that you current code introduces extra
dependencies.

You don't need two x86_64 page tables as you can easily map
all of the kernel virtual address, and the identity mapped physical
address until the x86_64 kernel stops using an 8TB/8TB split.

Eric

  reply	other threads:[~2006-05-02  7:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-01  9:49 [PATCH] kexec: Avoid overwriting the current pgd (i386) Magnus Damm
2006-05-01 14:35 ` [Fastboot] " Vivek Goyal
2006-05-01 16:37   ` Eric W. Biederman
2006-05-02  1:56     ` Magnus Damm
2006-05-02  7:15       ` Eric W. Biederman [this message]
2006-05-02  8:01         ` Magnus Damm
2006-05-02  1:35   ` Magnus Damm

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=m17j54aodw.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=magnus@valinux.co.jp \
    --cc=vgoyal@in.ibm.com \
    /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