Commit Graph

14 Commits

Author SHA1 Message Date
Kazuhito Hagio
c32abbf89d ARM: Fix uvtop conversion on LPAE
Currently arm_uvtop() calls arm_lpae_vtop() with the LPAE and it can
use LPAE_VTOP() also for a user virtual address.  Without this patch,
commands that use uvtop conversion such as "ps -a", "gcore" fail as
readmem() for a uvaddr returns a seek error:

  crash> ps -a 357
  ...
  ps: cannot access user stack address: bef2f97c
  crash> gcore
  gcore: seek error: physical address: 7ec56eab  type: "fill_psinfo: pr_psargs"
  Failed.

Fixes: https://github.com/crash-utility/crash-extensions/issues/2
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-04-19 09:53:30 +09:00
Dave Anderson
63df9c067d When accessing the 32-bit ARM kernel's "crash_notes" array, continue
to read the per-cpu NT_PRSTATUS note contents if an invalid note is
encountered.  Without the patch, if an invalid note is found, all
other notes were ignored, and subsequent "bt" attempts on the active
tasks would fail.
(chenqiwu@xiaomi.com, anderson@redhat.com)
2019-12-16 11:28:46 -05:00
Dave Anderson
8e21aa3fa5 32-bit ARM kernels built with the Thumb-2 instruction set utilize
the R7 register instead of FP for unwinding stacks using the DWARF
unwinder.  On those kernels, without the patch, the "bt" command
only shows the task header.
(vincent.whitchurch@axis.com)
2019-02-26 10:13:59 -05:00
Dave Anderson
9ef911789a Fix for 32-bit ARM kernels that are configured with CONFIG_SLAB
and contain percpu array_cache structures that were allocated with
vmalloc().  Without the patch, during session initialization there
will be error messages of the form: "crash: kmem_cache: <vaddr>:
invalid array_cache pointer: <vaddr>", and during runtime, the
"kmem -[sS]" commands will show kmem_cache lines that marked as
"[INVALID/CORRUPTED]".
(anderson@redhat.com)
2015-12-02 11:24:32 -05:00
Dave Anderson
d963c2c152 Update to the previous QEMU-specific patch to handle kdump dumpfiles
which have offline cpus, and therefore will not contain associated
NT_PRSTATUS notes in the dumpfile header.  Without the patch, if
there are any offline cpus, a segmentation violation is generated
during session initialization.
(anderson@redhat.com)
2015-11-23 14:24:56 -05:00
Dave Anderson
b2d8f20407 Fix for the handling of ARM and ARM64 QEMU-generated ELF dumpfiles
and compressed kdump clones.  The patch utilizes the NT_PRSTATUS
notes in the dumpfile headers instead of reading them from the
kernel's "crash_notes", which are not initialized when QEMU generates
a dumpfile.  Without the patch, these warning messages are displayed
during session initialization:

  WARNING: invalid note (n_type != NT_PRSTATUS)
  WARNING: cannot retrieve registers for active tasks

and running "bt" on an active task causes a segmentation violation.
(drjones@redhat.com)
2015-11-23 13:59:18 -05:00
Dave Anderson
da66825399 Fix for the 32-bit ARM virtual-to-physical address translation of
unity-mapped kernel virtual addresses in kernels configured with
CONFIG_ARM_LPAE if the system's phys_base exceeds 4GB.
(sdu.liu@huawei.com)
2014-12-18 09:37:02 -05:00
Dave Anderson
25bd7d9bf2 Fix for the determination of the cpu count on 32-bit ARM machines.
Without the patch, if certain patterns of cpus are offline, the count
may be too small, causing cpu-dependent commands to not recognize
online cpus.
(Jan.Karlsson@sonymobile.com, anderson@redhat.com)
2014-10-16 09:56:05 -04:00
Dave Anderson
5da8ffe605 Set the 32-bit ARM HZ value to a default value of 100 if the kernel
was not configured with CONFIG_IKCONFIG.  Without the patch, the
initial system banner and the "sys" command show "UPTIME: (cannot
calculate: unknown HZ value)", the "ps -t" option shows "RUN TIME:
(cannot calculate: unknown HZ value)", and the "timer -r" option
kills the crash session with a floating point exception.
(hukeping@huawei.com)
2014-09-29 11:33:27 -04:00
Dave Anderson
8185107da8 Improve the method for determining whether a 32-bit ARM vmlinux is
an LPAE enabled kernel by first checking whether CONFIG_ARM_LPAE
exists in the vmcoreinfo data, and if it does not, by then checking
whether the next higher symbol above "swapper_pg_dir" is 0x5000 bytes
higher in value.
(sdu.liu@huawei.com)
2014-09-22 14:37:17 -04:00
Dave Anderson
97a39ce0c7 If an ARM or ARM64 dumpfile does not contain the register sets of
the active tasks in the kernel's per-cpu crash_notes, there is an
initialization-time warning message indicating "could not retrieve
crash_notes".  It has been changed to a more meaningful warning
message indicating "cannot retrieve registers for active tasks".
(anderson@redhat.com)
2014-07-30 14:11:33 -04:00
Dave Anderson
ee0286b3b9 Introduce support for 32-bit ARM kernels that are configured with
CONFIG_ARM_LPAE.  The patch implements the virtual-to-physical
address translation of 64-bit PTEs used by ARM LPAE kernels.
(sdu.liu@huawei.com, weijitao@huawei.com)
2014-06-05 15:17:09 -04:00
Dave Anderson
8bff022b52 Fix for Linux 3.11 and later ARM kernels, in which all non-panicking
cpus offline themselves during a kdump procedure.  This causes an
invalid cpu count determination during crash session initialization
from an ARM vmcore.  The patch utilizes the cpu count found in the
cpu_active_map if it is greater than the count in the cpu_online_map.
In addition, the maximum NR_CPUS value for the ARM architecture has
been raised from 4 to 32.
(sdu.liu@huawei.com)
2014-04-28 15:45:51 -04:00
Dave Anderson
03e3937ec7 Initial commit: crash-7.0.4 2014-01-28 16:46:11 -05:00