[Crash-utility] [PATCH] arm64: Add lowercase tcr_el1_t1sz

lijiang lijiang at redhat.com
Wed May 26 03:19:55 UTC 2021


On Wed, May 26, 2021 at 10:34 AM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab at nec.com>
wrote:

> From: John Donnelly <john.p.donnelly at oracle.com>
>
> Commit 1c45cea "arm64: Change tcr_el1_t1sz variable name to
> TCR_EL1_T1SZ", renamed the variable to upper case, but there are
> kernels in existence that still have the lower case name, which
> breaks crash backwards compatibility.
>
>
Acked-by: Lianbo Jiang <lijiang at redhat.com>


> Resolves: https://github.com/crash-utility/crash/pull/82
> Signed-off-by: John Donnelly <john.p.donnelly at oracle.com>
> Signed-off-by: Kazuhito Hagio <k-hagio-ab at nec.com>
> ---
> The lowercase tcr_el1_t1sz was not seen upstream, but crash had it
> once, we should have added the uppercase name, not replaced it.
> So I ack this.
>
>  arm64.c   | 3 ++-
>  netdump.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arm64.c b/arm64.c
> index 4787fa61e3e5..8934961b109d 100644
> --- a/arm64.c
> +++ b/arm64.c
> @@ -3936,7 +3936,8 @@ arm64_calc_VA_BITS(void)
>                 } else if (ACTIVE())
>                         error(FATAL, "cannot determine VA_BITS_ACTUAL:
> please use /proc/kcore\n");
>                 else {
> -                       if ((string =
> pc->read_vmcoreinfo("NUMBER(TCR_EL1_T1SZ)"))) {
> +                       if ((string =
> pc->read_vmcoreinfo("NUMBER(TCR_EL1_T1SZ)")) ||
> +                           (string =
> pc->read_vmcoreinfo("NUMBER(tcr_el1_t1sz)"))) {
>                                 /* See ARMv8 ARM for the description of
>                                  * TCR_EL1.T1SZ and how it can be used
>                                  * to calculate the vabits_actual
> diff --git a/netdump.c b/netdump.c
> index c1c9cbfaed94..aaea945aaca7 100644
> --- a/netdump.c
> +++ b/netdump.c
> @@ -1921,7 +1921,8 @@ vmcoreinfo_read_string(const char *key)
>                         sprintf(value, "%ld", nd->arch_data2 & 0xffffffff);
>                         return value;
>                 }
> -               if (STREQ(key, "NUMBER(TCR_EL1_T1SZ)") && nd->arch_data2) {
> +               if ((STREQ(key, "NUMBER(TCR_EL1_T1SZ)") ||
> +                    STREQ(key, "NUMBER(tcr_el1_t1sz)")) &&
> nd->arch_data2) {
>                         value = calloc(VADDR_PRLEN+1, sizeof(char));
>                         sprintf(value, "%lld", ((ulonglong)nd->arch_data2
> >> 32) & 0xffffffff);
>                         pc->read_vmcoreinfo = no_vmcoreinfo;
> --
> 2.27.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20210526/209977eb/attachment.htm>


More information about the Crash-utility mailing list