From: Magnus Damm <magnus@valinux.co.jp>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: vgoyal@in.ibm.com, fastboot@lists.osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/03] kexec: Avoid overwriting the current pgd (V2)
Date: Thu, 25 May 2006 12:30:37 +0900 [thread overview]
Message-ID: <1148527837.5793.121.camel@localhost> (raw)
In-Reply-To: <m1k68astge.fsf@ebiederm.dsl.xmission.com>
Hi Eric,
On Wed, 2006-05-24 at 20:56 -0600, Eric W. Biederman wrote:
> Magnus Damm <magnus@valinux.co.jp> writes:
>
> > On Wed, 2006-05-24 at 18:56 -0400, Vivek Goyal wrote:
> >> On Wed, May 24, 2006 at 01:40:31PM +0900, Magnus Damm wrote:
> >> > kexec: Avoid overwriting the current pgd (V2)
> >> >
> >> > This patch updates the kexec code for i386 and x86_64 to avoid overwriting
> >> > the current pgd. For most people is overwriting the current pgd is not a big
> >> > problem. When kexec:ing into a new kernel that reinitializes and makes use
> > of
> >> > all memory we don't care about saving state.
> >> >
> >> > But overwriting the current pgd is not a good solution in the case of kdump
> >> > (CONFIG_CRASH_DUMP) where we want to preserve as much state as possible when
> >> > a crash occurs. This patch solves the overwriting issue.
> >> >
> >> > 20060524: V2
> >> >
> >> > - Broke out architecture-specific data structures into asm/kexec.h
> >> > - Fixed a i386/PAE page table problem only triggering on real hardware.
> >> > - Moved segment handling code into the assembly routines.
> >>
> >> What's the advantage of moving segment handling code into assembly
> >> routines? It will only add to the fear of control code page size growing
> >> beyond 4K.
> >
> > I have two main reasons:
> >
> > - Why wrap assembler instructions in C code if you just can move them
> > into an already existing assembly file? Much cleaner IMO.
>
> C code is much more accessible to other programmers than arch specific
> assembly. The code on the control page was almost written in C, and
> I'm still not quite convinced that it would be wrong to do that.
I agree with you that it is of course better to implement something in C
if possible compared to writing it in architecture-specific assembly.
But I do not agree that wrapping architecture-specific assembly code in
C functions makes the code more understandable. I'd really like to meet
the kernel hacker that is aware of how x86 segmentation works but is
unable to read x86 assembly.
> > - I'm currently working on making kexec to work under xen/dom0. And by
> > moving the segment handling code into the assembly file we reduce the
> > amount of duplicated code.
>
> Not the reason I would have expected. So you are only differring the
> two implementations by the contents of the control code page?
Nah, there's a fairly large framework to pass pages to the hypervisor,
converting pfn:s to mfn:s, building page tables etc. We will resend the
patches later on today to xen-devel if you're interested.
Thanks,
/ magnus
next prev parent reply other threads:[~2006-05-25 3:28 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 4:40 [PATCH 00/03] kexec: Avoid overwriting the current pgd (V2) Magnus Damm
2006-05-24 4:40 ` [PATCH 01/03] kexec: Avoid overwriting the current pgd (V2, stubs) Magnus Damm
2006-05-25 2:41 ` [Fastboot] " Eric W. Biederman
2006-05-25 3:45 ` Magnus Damm
2006-05-25 4:37 ` Eric W. Biederman
2006-05-25 7:11 ` Magnus Damm
2006-05-25 16:36 ` Eric W. Biederman
2006-05-26 2:23 ` Magnus Damm
2006-05-24 4:40 ` [PATCH 02/03] kexec: Avoid overwriting the current pgd (V2, i386) Magnus Damm
2006-05-24 22:58 ` Vivek Goyal
2006-05-25 2:14 ` Magnus Damm
2006-05-25 2:18 ` [Fastboot] " Eric W. Biederman
2006-05-25 2:38 ` [Fastboot] " Eric W. Biederman
2006-05-24 4:40 ` [PATCH 03/03] kexec: Avoid overwriting the current pgd (V2, x86_64) Magnus Damm
2006-05-25 2:50 ` [Fastboot] " Eric W. Biederman
2006-05-25 8:26 ` Magnus Damm
2006-05-25 15:21 ` Vivek Goyal
2006-05-26 10:42 ` Magnus Damm
2006-05-26 15:08 ` Vivek Goyal
2006-05-26 15:52 ` Magnus Damm
2006-05-25 16:01 ` Eric W. Biederman
2006-05-26 3:17 ` Magnus Damm
2006-05-26 16:32 ` Eric W. Biederman
2006-05-29 8:40 ` Magnus Damm
2006-05-31 17:19 ` Vivek Goyal
2006-05-26 7:40 ` Gerd Hoffmann
2006-05-26 9:02 ` Magnus Damm
2006-05-26 9:18 ` Eric W. Biederman
2006-05-26 9:29 ` Magnus Damm
2006-05-24 22:56 ` [PATCH 00/03] kexec: Avoid overwriting the current pgd (V2) Vivek Goyal
2006-05-25 2:09 ` Magnus Damm
2006-05-25 2:56 ` Eric W. Biederman
2006-05-25 3:30 ` Magnus Damm [this message]
2006-05-25 4:51 ` Eric W. Biederman
2006-05-25 7:29 ` [Fastboot] " Magnus Damm
2006-05-25 16:40 ` Eric W. Biederman
2006-05-26 1:57 ` 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=1148527837.5793.121.camel@localhost \
--to=magnus@valinux.co.jp \
--cc=ebiederm@xmission.com \
--cc=fastboot@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--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