[PATCH] Fix pvops Xen detection for arm machine
by Qi Zheng
Since the xen_start_info on the arm/arm64 platform is static defined:
./arm/xen/enlighten.c:40:static struct start_info _xen_start_info;
./arm/xen/enlighten.c:41:struct start_info *xen_start_info = &_xen_start_info;
./arm/xen/enlighten.c:42:EXPORT_SYMBOL(xen_start_info);
The is_pvops_xen() in commit 4badc6229c69f5cd9da7eb7bdf400a53ec6db01a
("Fix pvops Xen detection for kernels >= v4.20") always return TRUE.
Then the following error will be reported because p2m_mid_missing
and xen_p2m_addr are not defined:
crash: cannot resolve "p2m_top"
Fix it by using xen_vcpu_id instead of xen_start_info to detect Xen dumps.
Signed-off-by: Qi Zheng <zhengqi.arch(a)bytedance.com>
---
kernel.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/kernel.c b/kernel.c
index f4598ea..24bf479 100644
--- a/kernel.c
+++ b/kernel.c
@@ -10745,6 +10745,9 @@ is_pvops_xen(void)
{
ulong addr;
char *sym;
+ struct syment * sp;
+ ulong ptr;
+ int i;
if (!PVOPS())
return FALSE;
@@ -10757,11 +10760,19 @@ is_pvops_xen(void)
STREQ(sym, "paravirt_patch_default")))
return TRUE;
- if (symbol_exists("xen_start_info") &&
- readmem(symbol_value("xen_start_info"), KVADDR, &addr,
- sizeof(void *), "xen_start_info", RETURN_ON_ERROR) &&
- addr != 0)
- return TRUE;
+ sp = per_cpu_symbol_search("xen_vcpu_id");
+ if (sp) {
+ for (i = 0; i < NR_CPUS; i++) {
+ if (!kt->__per_cpu_offset[i])
+ continue;
+
+ ptr = sp->value + kt->__per_cpu_offset[0];
+ if (ptr && readmem(ptr, KVADDR, &ptr, sizeof(uint32_t),
+ "xen_vcpu_id", FAULT_ON_ERROR))
+ return TRUE;
+ return FALSE;
+ }
+ }
return FALSE;
}
--
2.11.0
2 years, 11 months
[ANNOUNCE] crash gcore command, version 1.6.3 is released
by d.hatayama@fujitsu.com
This is the release of crash gcore command, version 1.6.3.
You can get it at:
https://github.com/fujitsu/crash-gcore/releases/tag/v1.6.3
ChangeLog:
- Adding ZRAM support. To use this feature, crash v7.3.0 or newer is
required.
(d.hatayama(a)fujitsu.com)
- Setting DT_SONAME field to gcore.so. This change was needed to follow
the fedora packaging guideline. Without this change, fedpkg lint command
outputs the corresponding warning message.
(d.hatayama(a)fujitsu.com)
- gcore has become a bit more robust. Previously, gcore terminated creating
core file when there is any failure reading user-space memory.
Now gcore continues the core file creation even if any failure occurs,
then the corresponding data is filled with \0 byte instead.
(d.hatayama(a)fujitsu.com)
bug fix
- Fix the issue that on the kernels v5.11 or later, gcore generates core
files in ELF64 format for the tasks running in 32-bit compatible mode.
This is due to the kernel's commit 8d71d2bf6efec3032208958c483a247f529ffb16
(x86: Reclaim TIF_IA32 and TIF_X32) that removed TIF_IA32, by which
tasks running in 32-bit compatible mode are no longer marked with the flag.
(d.hatayama(a)fujitsu.com)
- Fix segmentation fault of crash process during loading gcore.so on live kernel.
(d.hatayama(a)fujitsu.com)
- Fix miscalculation of the starting address of the pt_regs structure
on the kernel stack on aarch64. This was introduced at the work error that
occurred when I merged the commit 19bfb92e50799a82f7ce6179fb35ccd82061bafd.
(hong.yang3(a)nio.com, vincent.whitchurch(a)axis.com)
--
Thanks.
HATAYAMA, Daisuke
2 years, 11 months
Re: [Crash-utility] arm64: Support overflow stack panic
by lijiang
Hi, Hong
Thank you for the patch. I added the comments below, other changes look
good to me.
@@ -1978,7 +2028,10 @@ arm64_in_exception_text(ulong ptr)
if ((ptr >= ms->__exception_text_start) &&
(ptr < ms->__exception_text_end))
return TRUE;
- } else if ((name = closest_symbol(ptr))) { /* Linux 5.5 and later
*/
+ }
+
+ name = closest_symbol(ptr);
+ if (name != NULL) { /* Linux 5.5 and later */
The above changes are irrelevant to your patch itself. But anyway this
looks more readable to me.
for (func = &arm64_exception_functions[0]; *func; func++) {
if (STREQ(name, *func))
return TRUE;
@@ -2255,12 +2308,14 @@ arm64_unwind_frame(struct bt_info *bt, struct
arm64_stackframe *frame)
if (!(machdep->flags & IRQ_STACKS))
return TRUE;
- if (!(machdep->flags & IRQ_STACKS))
+ if (!(machdep->flags & OVERFLOW_STACKS))
return TRUE;
Originally, it had two same(repeated) statements, one of which must be
redundant. This time, can it be changed to a statement as below?
if (!(machdep->flags & (IRQ_STACKS | OVERFLOW_STACKS)))
return TRUE;
BTW: this patch was sent as an attachment, which is inconvenient for other
reviewers to add comments.
In addition, I have a request: can you share the vmcore with me if it
doesn't have confidential data? I'm collecting the specific vmcore
for the test, at least I haven't reproduced it.
Thanks.
Lianbo
2 years, 12 months