From: "Magnus Damm" <magnus.damm@gmail.com>
To: vgoyal@in.ibm.com
Cc: "Magnus Damm" <magnus@valinux.co.jp>,
"Andrew Morton" <akpm@osdl.org>,
fastboot@lists.osdl.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org
Subject: Re: [Fastboot] [PATCH 03/03] kexec: Avoid overwriting the current pgd (V2, x86_64)
Date: Fri, 26 May 2006 19:42:53 +0900 [thread overview]
Message-ID: <aec7e5c30605260342w2fde795fr8f4d8120c74e3687@mail.gmail.com> (raw)
In-Reply-To: <20060525152112.GA6791@in.ibm.com>
On 5/26/06, Vivek Goyal <vgoyal@in.ibm.com> wrote:
> On Thu, May 25, 2006 at 05:26:56PM +0900, Magnus Damm wrote:
> > So, to answer your question regarding two page table copies. You may be
> > right that it can be made work with just one page table, but I feel my
> > two table approach is nice because it will always work - regardless of
> > the memory map used.
>
> So you seem to be suggesting that code can be made to work (even with Xen)
> with single identity mapped page table as used currently but it would fail
> in certain circumstances (different memory map used). Can you please explain
> a little more how?
Sorry about the delay, your question needed some thinking.
I do not think that vanilla kexec x86_64 has any memory map related
problems, apart for the page table overwriting. And the page table
overwriting is not a bug that will make kdump fail, it just makes the
memory image less accurate. I do however think the accuracy is quite
important given that kdump mainly is used for memory image collection.
The main reason for using two sets of page tables is simplicity. The
page_table_a code for allocation and page table setup is more or less
identical for i386 and x86_64. The code was written to be generic, but
during the testing I realized that the architecture-specific header
files defined things differently so I needed to add some
architecture-specific macros as workarounds. It should be possible to
share the code in a common file.
Simon and I have tried to make the Xen port of kexec as simple as
possible. One design decision that I know Eric dislikes is the array
of pages for page_table_a. The reason behind this array is simplicity,
especially for our Xen port.
Our Xen port makes the dom0 kernel responsible for allocating pages.
These pages are then used by the hypervisor. Some of these pages are
page_table_a pages, and these pages are overwritten by the hypervisor
with mappings that fit the memory map used by Xen. If we would pass
the root pointer instead of an array of pages then the hypervisor
would have to be extended to include code to parse page tables,
extract pages and then fill in the new page table. That would be all
but simple.
Using a single page table with Xen would probably result in a more
complex solution - the hypervisor code must be able to parse both page
tables with both huge and normal pages. I feel that such a solution is
error prone and overly complex. Especially since we already have
something that works.
I must admit that I got a bit scared of all the different page table
modes that Xen can run in. If and how they can affect the memory map
is beyond me. So instead of thinking of _how_ the memory maps are
arranged under x86_64, i386, i386/pae using all config options I
thought it was better to write something generic.
That's how the page_table_a strategy came up. It came up as a way of
jumping to a physical address from any virtual address, regardless of
memory map.
> This might be a very stupid question given the fact I am blissfully unaware
> of all the details of Xen.
No worries. "blissfully unaware of all the details of xen"... you
lucky bastard! =)
Thank you for your comments!
/ magnus
next prev parent reply other threads:[~2006-05-26 10:42 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 [this message]
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
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=aec7e5c30605260342w2fde795fr8f4d8120c74e3687@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=akpm@osdl.org \
--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®