[Crash-utility] [PATCH v3 1/2] arm64: read pagesize
Dave Anderson
anderson at redhat.com
Fri Nov 20 19:19:01 UTC 2015
----- Original Message -----
> Thanks to kernel commit 9d372c9fab34 "arm64: Add page size to the
> kernel image header", we don't need a heuristic to determine the
> pagesize on arm64. Keep the heuristic for older kernels, but try
> reading the header first.
This looks good -- I also added the new kernel_flags field to arm64_dump_machdep_table()
for display by "help -m". Queued for crash-7.1.4:
https://github.com/crash-utility/crash/commit/2d8895c36a3a533b6555a21c86601b663f1f4f44
Thanks,
Dave
> ---
> arm64.c | 30 ++++++++++++++++++++++++++++++
> defs.h | 1 +
> 2 files changed, 31 insertions(+)
>
> diff --git a/arm64.c b/arm64.c
> index 5f8e2f6852434..9d03d1d54b574 100644
> --- a/arm64.c
> +++ b/arm64.c
> @@ -19,6 +19,7 @@
>
> #include "defs.h"
> #include <elf.h>
> +#include <endian.h>
>
> #define NOT_IMPLEMENTED(X) error((X), "%s: function not implemented\n",
> __func__)
>
> @@ -97,6 +98,32 @@ arm64_init(int when)
> break;
>
> case PRE_GDB:
> + if (!machdep->pagesize) {
> + /*
> + * Kerneldoc Documentation/arm64/booting.txt describes
> + * the kernel image header flags field.
> + */
> + value = machdep->machspec->kernel_flags;
> + value = (value >> 1) & 3;
> +
> + switch(value)
> + {
> + case 0:
> + break;
> + case 1:
> + machdep->pagesize = 4096;
> + break;
> + case 2:
> + /* TODO: machdep->pagesize = 16384; */
> + error(FATAL, "16K pages not supported.");
> + break;
> + case 3:
> + machdep->pagesize = 65536;
> + break;
> + }
> +
> + }
> +
> if (!machdep->pagesize &&
> kernel_symbol_exists("swapper_pg_dir") &&
> kernel_symbol_exists("idmap_pg_dir")) {
> @@ -305,6 +332,9 @@ arm64_verify_symbol(const char *name, ulong value, char
> type)
> if (!name || !strlen(name))
> return FALSE;
>
> + if ((type == 'A') && STREQ(name, "_kernel_flags_le"))
> + machdep->machspec->kernel_flags = le64toh(value);
> +
> if (((type == 'A') || (type == 'a')) && (highest_bit_long(value) != 63))
> return FALSE;
>
> diff --git a/defs.h b/defs.h
> index 7004619017e41..3e5dbd99942b2 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -2944,6 +2944,7 @@ struct machine_specific {
> ulong crash_kexec_end;
> ulong crash_save_cpu_start;
> ulong crash_save_cpu_end;
> + ulong kernel_flags;
> };
>
> struct arm64_stackframe {
> --
> 2.4.3
>
>
More information about the Crash-utility
mailing list