Dear maintainers

Are there any comments for this patch set?

I think it's neccessary patch to parsing in aarch64.



From: 赵乾利
Sent: Monday, November 30, 2020 6:21:48 PM
To: crash-utility@redhat.com
Subject: [PATCH] arm64: update mapping symbol filter in arm64_verify_symbol
 
From: Qianli Zhao <zhaoqianli@xiaomi.com>

Name Meaning of mapping symbol:
$x
$x.<any...>
Start of a sequence of A64 instructions

$c
$c.<any...>
Start of a sequence of C64 instructions

$d
$d.<any...>
Start of a sequence of data items (for example, a literal pool)

Reference documents:
https://documentation-service.arm.com/static/5f9a92f6b1a7c5445f28fee6?token=

Signed-off-by: Qianli Zhao <zhaoqianli@xiaomi.com>
---
When use crash-arm64 parsing kdump,"dis" command can not completely parse out the disassembly code(aarch64-objdump is ok),miss some assembly code at the end,such as below:

The queued_spin_lock_slowpath() actual code segment of the function is from 0xffffffdf44b80d48 to ffffffecc41591d4,but "dis" command only dump from 0xffffffdf44b80d48 to 0xffffffdf44b80df0.

crash> dis queued_spin_lock_slowpath
0xffffffdf44b80d48 <$x.1>:      str     x30, [x18],#8
0xffffffdf44b80d4c <queued_spin_lock_slowpath+4>:       stp     x29, x30, [sp,#-64]!
....
0xffffffdf44b80dec <queued_spin_lock_slowpath+164>:     cbnz    w10, 0xffffffdf44b80e9c
0xffffffdf44b80df0 <queued_spin_lock_slowpath+168>:     nop

The reason for the issue is that crash-tool thinks next vaild symbol is $x.3,but $x.* is a mapping symbol defined by ARM,this type of symbol needs skip.

ffffffdf44b80d48 (T) queued_spin_lock_slowpath
ffffffdf44b80df4 (t) $x.3
ffffffdf44b80dfc (t) $x.5
ffffffdf44b80e24 (t) $x.7
ffffffdf44b80e2c (t) $x.9
ffffffdf44b80f6c (t) $x.13
ffffffdf44b80f74 (t) $x.15
ffffffdf44b8102c (t) $x.19
ffffffdf44b81034 (t) $x.21
ffffffdf44b810e8 (t) $x.7
ffffffdf44b810e8 (T) rt_mutex_adjust_pi
ffffffdf44b8118c (t) $x.8

This issue will mislead us to analyze assembly issue:
[20332.505051] Call trace:
[20332.505057]  queued_spin_lock_slowpath+0x198/0x3a0---->//Beyond code segment?
[20332.505063]  do_raw_spin_lock+0x10c/0x12c
[20332.505071]  _raw_spin_lock_irqsave+0x3c/0x50
[20332.505080]  set_dspp_hist_irq_feature+0x180/0x1d4
[20332.505089]  sde_cp_crtc_setfeature+0x168/0x2f4
[20332.505095]  sde_cp_crtc_apply_properties+0x46c/0x76c
[20332.505102]  sde_crtc_atomic_begin+0x490/0x62c
[20332.505111]  drm_atomic_helper_commit_planes+0x5c/0x2bc
[20332.505117]  complete_commit+0xa0/0x264
[20332.505123]  _msm_drm_commit_work_cb+0x128/0x22c
[20332.505130]  kthread_worker_fn+0x110/0x1ac
[20332.505136]  kthread+0x160/0x170
[20332.505143]  ret_from_fork+0x10/0x18


Reference documents(page 7):
https://documentation-service.arm.com/static/5f9a92f6b1a7c5445f28fee6?token=
---

 arm64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arm64.c b/arm64.c
index fdf77bd..24fd91e 100644
--- a/arm64.c
+++ b/arm64.c
@@ -510,9 +510,11 @@ arm64_verify_symbol(const char *name, ulong value, char type)
            ((type == 'a') || (type == 'n') || (type == 'N') || (type == 'U')))
                return FALSE;

-       if (STREQ(name, "$d") || STREQ(name, "$x"))
+       if (STREQ(name, "$d") || STRNEQ(name, "$d.") ||
+               STREQ(name, "$x") || STRNEQ(name, "$x.") ||
+               STREQ(name, "$c") || STRNEQ(name, "$c."))
                return FALSE;
-      
+
        if ((type == 'A') && STRNEQ(name, "__crc_"))
                return FALSE;

--
2.7.4
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#