Re: [Fastboot] [PATCH] kexec: Avoid overwriting the current pgd (i386)

From: Magnus Damm
Date: Mon May 01 2006 - 21:35:16 EST


On 5/1/06, Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:
On Mon, May 01, 2006 at 06:49:16PM +0900, Magnus Damm wrote:
> kexec: Avoid overwriting the current pgd (i386)
>
> This patch upgrades the i386-specific kexec code to avoid overwriting the
> current pgd. Overwriting the current pgd is bad when CONFIG_CRASH_DUMP is used
> to start a secondary kernel that dumps the memory of the previous kernel.
>
> The code introduces a new set of page tables called "page_table_a". These
> tables are used to provide an executable identity mapping without overwriting
> the current pgd.

True, current pgd is overwritten but that effects only user space mappings
and currently "crash" supports only backtracing kernel space code. But at
the same time probably it is not a bad idea to maintain a separate page
table and switch to that instead of overwriting the existing pgd. This
shall help if in future user space backtracing is also supported.

I agree, but I also think that overwriting user space mappings is bad
from the trace perspective too, especially if you look at kernel data.
I would say that user space page tables are just another kernel data
structure, and overwriting them may result in things like inconsistent
page->mapcount values.

Thanks for the comments,

/ magnus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/