From: "Magnus Damm" <magnus.damm@gmail.com>
To: "Eric W. Biederman" <ebiederm@xmission.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, 2 May 2006 10:56:09 +0900 [thread overview]
Message-ID: <aec7e5c30605011856v5023b8fdwf8542c746a8a09dd@mail.gmail.com> (raw)
In-Reply-To: <m1u089aegp.fsf@ebiederm.dsl.xmission.com>
On 5/2/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
> Vivek Goyal <vgoyal@in.ibm.com> writes:
> > On Mon, May 01, 2006 at 06:49:16PM +0900, Magnus Damm wrote:
> >> --- 0001/include/linux/kexec.h
> >> +++ work/include/linux/kexec.h 2006-05-01 11:13:14.000000000 +0900
> >> @@ -69,6 +69,17 @@ struct kimage {
> >> unsigned long start;
> >> struct page *control_code_page;
> >>
> >> + /* page_table_a[] holds enough pages to create a new page table
> >> + * that maps the control page twice..
> >> + */
> >> +
> >> +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
> >> + struct page *page_table_a[3]; /* (2 * pte) + pgd */
> >> +#endif
> >> +#if defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
> >> + struct page *page_table_a[5]; /* (2 * pte) + (2 * pmd) + pgd */
> >> +#endif
> >> +
> >
> > Would it make a cleaner interface if these array of pointers are maintained
> > in arch dependent code as global variables instead of putting in arch
> > independent code. Existing code does something simlar. This becomes further
> > ugly when another array comes into the picture for x86_64 in next patch.
> > (page_table_b)
>
> 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.
Thanks for the input,
/ magnus
next prev parent reply other threads:[~2006-05-02 1:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-01 9:49 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 [this message]
2006-05-02 7:15 ` Eric W. Biederman
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=aec7e5c30605011856v5023b8fdwf8542c746a8a09dd@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=ebiederm@xmission.com \
--cc=fastboot@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®