On Wed, May 26, 2021 at 10:34 AM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@nec.com> wrote:
From: John Donnelly <john.p.donnelly@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@redhat.com>
 
Resolves: https://github.com/crash-utility/crash/pull/82
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@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