----- Original Message -----
> In this case the original PGD is lost forever. But we can
certainly detect
> that and bail out instead of confusing our users. Maybe something like the
> patch below?
>
> Note that I have not tested it on 3.2+ dump (I have none) but it works on the
> dumps I have.
>
> Per, Jan, any comments on this?
>
> diff --git a/arm.c b/arm.c
> index a3a7c23..03f63e6 100644
> --- a/arm.c
> +++ b/arm.c
> @@ -265,6 +265,10 @@ arm_init(int when)
> STRUCT_EXISTS("pteval_t"))
> machdep->flags |= PGTABLE_V2;
>
> + if (THIS_KERNEL_VERSION >= LINUX(3,2,0) ||
> + symbol_exists("idmap_pgd"))
> + machdep->flags |= IDMAP_PGD;
> +
> machdep->section_size_bits = _SECTION_SIZE_BITS;
> machdep->max_physmem_bits = _MAX_PHYSMEM_BITS;
>
> @@ -352,6 +356,8 @@ arm_dump_machdep_table(ulong arg)
> fprintf(fp, "%sPHYS_BASE", others++ ? "|" : "");
> if (machdep->flags & PGTABLE_V2)
> fprintf(fp, "%sPGTABLE_V2", others++ ? "|" : "");
> + if (machdep->flags & IDMAP_PGD)
> + fprintf(fp, "%sIDMAP_PGD", others++ ? "|" : "");
> fprintf(fp, ")\n");
>
> fprintf(fp, " kvbase: %lx\n", machdep->kvbase);
> @@ -1042,6 +1048,15 @@ arm_uvtop(struct task_context *tc, ulong
> uvaddr, physaddr_t *paddr, int verbose)
> if (!tc)
> error(FATAL, "current context invalid\n");
>
> + /*
> + * Before idmap_pgd was introduced with upstream commit 2c8951ab0c
> + * (ARM: idmap: use idmap_pgd when setting up mm for reboot), the
> + * panic task pgd was overwritten by soft reboot code, so we can't do
> + * any vtop translations.
> + */
> + if (!(machdep->flags & IDMAP_PGD) && tc->task ==
tt->panic_task)
> + error(FATAL, "panic task pgd is trashed by soft reboot code\n");
> +
> *paddr = 0;
>
> if (is_kernel_thread(tc->task) && IS_KVADDR(uvaddr)) {
> diff --git a/defs.h b/defs.h
> index 1f693c3..8b8b9f3 100755
> --- a/defs.h
> +++ b/defs.h
> @@ -4649,6 +4649,7 @@ struct arm_pt_regs {
> #define KSYMS_START (0x1)
> #define PHYS_BASE (0x2)
> #define PGTABLE_V2 (0x4)
> +#define IDMAP_PGD (0x8)
>
> struct machine_specific {
> ulong phys_base;
>
Unless NAK'd by Per or Jan, then consider it queued for crash-6.1.5.
Thanks,
Dave
Actually, I think this part of the patch should be changed to be
"THIS_KERNEL_VERSION >= LINUX(3,3,0)":
+ if (THIS_KERNEL_VERSION >= LINUX(3,2,0) ||
+ symbol_exists("idmap_pgd"))
+ machdep->flags |= IDMAP_PGD;
+
because:
$ git describe --contains 2c8951ab0c337cb198236df07ad55f9dd4892c26
v3.3-rc1~18^2~3^2~15^2~2
$
If you download the base linux-3.2.tar.gz and linux-3.3.tar.gz files,
you'll set that "idmap_pgd" does not exist in linux-3.2, but it does
show up in linux-3.3.
I'll change that...
Thanks,
Dave