|
|
@ -1,13 +1,16 @@
|
|
|
|
commit fe84f31c36bff278f68553d521c983836c5670e2
|
|
|
|
From 1bc151ee1304318ecb36d6158afe40852bc4b7f4 Mon Sep 17 00:00:00 2001
|
|
|
|
Author: Bhupesh Sharma <bhsharma@redhat.com>
|
|
|
|
From: Bhupesh Sharma <bhsharma@redhat.com>
|
|
|
|
Date: Tue Dec 1 02:23:53 2020 +0530
|
|
|
|
Date: Tue, 1 Dec 2020 02:23:53 +0530
|
|
|
|
|
|
|
|
Subject: [PATCH] arm64 crash fix for older kernels
|
|
|
|
arm64 crash fix for older kernels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
|
|
|
|
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
arm64.c | 512 +++++++++++---------------------------------------------
|
|
|
|
|
|
|
|
defs.h | 18 +-
|
|
|
|
|
|
|
|
2 files changed, 102 insertions(+), 428 deletions(-)
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/arm64.c b/arm64.c
|
|
|
|
diff --git a/arm64.c b/arm64.c
|
|
|
|
index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
index 4787fa61e3e5..68347b131aef 100644
|
|
|
|
--- a/arm64.c
|
|
|
|
--- a/arm64.c
|
|
|
|
+++ b/arm64.c
|
|
|
|
+++ b/arm64.c
|
|
|
|
@@ -27,13 +27,9 @@
|
|
|
|
@@ -27,13 +27,9 @@
|
|
|
@ -204,7 +207,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -655,20 +619,9 @@ arm64_dump_machdep_table(ulong arg)
|
|
|
|
@@ -657,20 +621,9 @@ arm64_dump_machdep_table(ulong arg)
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(fp, " machspec: %lx\n", (ulong)ms);
|
|
|
|
fprintf(fp, " machspec: %lx\n", (ulong)ms);
|
|
|
|
fprintf(fp, " VA_BITS: %ld\n", ms->VA_BITS);
|
|
|
|
fprintf(fp, " VA_BITS: %ld\n", ms->VA_BITS);
|
|
|
@ -228,7 +231,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
else
|
|
|
|
else
|
|
|
|
fprintf(fp, "(unused)\n");
|
|
|
|
fprintf(fp, "(unused)\n");
|
|
|
|
fprintf(fp, " userspace_top: %016lx\n", ms->userspace_top);
|
|
|
|
fprintf(fp, " userspace_top: %016lx\n", ms->userspace_top);
|
|
|
|
@@ -757,14 +710,12 @@ arm64_parse_machdep_arg_l(char *argstring, char *param, ulong *value)
|
|
|
|
@@ -759,14 +712,12 @@ arm64_parse_machdep_arg_l(char *argstring, char *param, ulong *value)
|
|
|
|
int flags = RETURN_ON_ERROR | QUIET;
|
|
|
|
int flags = RETURN_ON_ERROR | QUIET;
|
|
|
|
int err = 0;
|
|
|
|
int err = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -246,7 +249,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
*value = htol(p, flags, &err);
|
|
|
|
*value = htol(p, flags, &err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -830,12 +781,6 @@ arm64_parse_cmdline_args(void)
|
|
|
|
@@ -832,12 +783,6 @@ arm64_parse_cmdline_args(void)
|
|
|
|
"setting max_physmem_bits to: %ld\n\n",
|
|
|
|
"setting max_physmem_bits to: %ld\n\n",
|
|
|
|
machdep->max_physmem_bits);
|
|
|
|
machdep->max_physmem_bits);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -259,7 +262,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
error(WARNING, "ignoring --machdep option: %s\n",
|
|
|
|
error(WARNING, "ignoring --machdep option: %s\n",
|
|
|
|
@@ -844,60 +789,11 @@ arm64_parse_cmdline_args(void)
|
|
|
|
@@ -846,60 +791,11 @@ arm64_parse_cmdline_args(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -321,7 +324,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
if (ms->kimage_voffset) /* vmcoreinfo, ioctl, or --machdep override */
|
|
|
|
if (ms->kimage_voffset) /* vmcoreinfo, ioctl, or --machdep override */
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@@ -905,6 +801,7 @@ arm64_calc_kimage_voffset(void)
|
|
|
|
@@ -907,6 +803,7 @@ arm64_calc_kimage_voffset(void)
|
|
|
|
if (ACTIVE()) {
|
|
|
|
if (ACTIVE()) {
|
|
|
|
char buf[BUFSIZE];
|
|
|
|
char buf[BUFSIZE];
|
|
|
|
char *p1;
|
|
|
|
char *p1;
|
|
|
@ -329,7 +332,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
FILE *iomem;
|
|
|
|
FILE *iomem;
|
|
|
|
ulong kimage_voffset, vaddr;
|
|
|
|
ulong kimage_voffset, vaddr;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -945,24 +842,9 @@ arm64_calc_kimage_voffset(void)
|
|
|
|
@@ -947,24 +844,9 @@ arm64_calc_kimage_voffset(void)
|
|
|
|
if (errflag)
|
|
|
|
if (errflag)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
@ -357,7 +360,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
error(WARNING,
|
|
|
|
error(WARNING,
|
|
|
|
"kimage_voffset cannot be determined from the dumpfile.\n");
|
|
|
|
"kimage_voffset cannot be determined from the dumpfile.\n");
|
|
|
|
error(CONT,
|
|
|
|
error(CONT,
|
|
|
|
@@ -978,25 +860,6 @@ arm64_calc_kimage_voffset(void)
|
|
|
|
@@ -980,25 +862,6 @@ arm64_calc_kimage_voffset(void)
|
|
|
|
ms->kimage_voffset += (kt->relocate * -1);
|
|
|
|
ms->kimage_voffset += (kt->relocate * -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -383,7 +386,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
arm64_calc_phys_offset(void)
|
|
|
|
arm64_calc_phys_offset(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -1020,16 +883,10 @@ arm64_calc_phys_offset(void)
|
|
|
|
@@ -1022,16 +885,10 @@ arm64_calc_phys_offset(void)
|
|
|
|
physaddr_t paddr;
|
|
|
|
physaddr_t paddr;
|
|
|
|
ulong vaddr;
|
|
|
|
ulong vaddr;
|
|
|
|
struct syment *sp;
|
|
|
|
struct syment *sp;
|
|
|
@ -400,7 +403,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
vaddr = symbol_value_from_proc_kallsyms("memstart_addr");
|
|
|
|
vaddr = symbol_value_from_proc_kallsyms("memstart_addr");
|
|
|
|
if (vaddr == BADVAL)
|
|
|
|
if (vaddr == BADVAL)
|
|
|
|
vaddr = sp->value;
|
|
|
|
vaddr = sp->value;
|
|
|
|
@@ -1092,31 +949,6 @@ arm64_calc_phys_offset(void)
|
|
|
|
@@ -1094,31 +951,6 @@ arm64_calc_phys_offset(void)
|
|
|
|
fprintf(fp, "using %lx as phys_offset\n", ms->phys_offset);
|
|
|
|
fprintf(fp, "using %lx as phys_offset\n", ms->phys_offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -432,7 +435,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Determine PHYS_OFFSET either by reading VMCOREINFO or the kernel
|
|
|
|
* Determine PHYS_OFFSET either by reading VMCOREINFO or the kernel
|
|
|
|
@@ -1172,14 +1004,9 @@ ulong
|
|
|
|
@@ -1174,14 +1006,9 @@ ulong
|
|
|
|
arm64_VTOP(ulong addr)
|
|
|
|
arm64_VTOP(ulong addr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (machdep->flags & NEW_VMEMMAP) {
|
|
|
|
if (machdep->flags & NEW_VMEMMAP) {
|
|
|
@ -449,7 +452,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
else if (machdep->machspec->kimage_voffset)
|
|
|
|
else if (machdep->machspec->kimage_voffset)
|
|
|
|
return addr - machdep->machspec->kimage_voffset;
|
|
|
|
return addr - machdep->machspec->kimage_voffset;
|
|
|
|
else /* no randomness */
|
|
|
|
else /* no randomness */
|
|
|
|
@@ -1253,11 +1080,6 @@ arm64_uvtop(struct task_context *tc, ulong uvaddr, physaddr_t *paddr, int verbos
|
|
|
|
@@ -1255,11 +1082,6 @@ arm64_uvtop(struct task_context *tc, ulong uvaddr, physaddr_t *paddr, int verbos
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -458,10 +461,10 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
-#define PTE_TO_PHYS(pteval) (machdep->max_physmem_bits == 52 ? \
|
|
|
|
-#define PTE_TO_PHYS(pteval) (machdep->max_physmem_bits == 52 ? \
|
|
|
|
- (((pteval & PTE_ADDR_LOW) | ((pteval & PTE_ADDR_HIGH) << 36))) : (pteval & PTE_ADDR_LOW))
|
|
|
|
- (((pteval & PTE_ADDR_LOW) | ((pteval & PTE_ADDR_HIGH) << 36))) : (pteval & PTE_ADDR_LOW))
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
#define PUD_TYPE_MASK 3
|
|
|
|
|
|
|
|
#define PUD_TYPE_SECT 1
|
|
|
|
#define PMD_TYPE_MASK 3
|
|
|
|
#define PMD_TYPE_MASK 3
|
|
|
|
#define PMD_TYPE_SECT 1
|
|
|
|
@@ -1355,7 +1177,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
#define PMD_TYPE_TABLE 2
|
|
|
|
|
|
|
|
@@ -1350,7 +1172,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
|
|
|
|
* #define __PAGETABLE_PUD_FOLDED
|
|
|
|
* #define __PAGETABLE_PUD_FOLDED
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
@ -470,7 +473,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
FILL_PMD(pmd_base, KVADDR, PTRS_PER_PMD_L3_64K * sizeof(ulong));
|
|
|
|
FILL_PMD(pmd_base, KVADDR, PTRS_PER_PMD_L3_64K * sizeof(ulong));
|
|
|
|
pmd_ptr = pmd_base + (((vaddr) >> PMD_SHIFT_L3_64K) & (PTRS_PER_PMD_L3_64K - 1));
|
|
|
|
pmd_ptr = pmd_base + (((vaddr) >> PMD_SHIFT_L3_64K) & (PTRS_PER_PMD_L3_64K - 1));
|
|
|
|
pmd_val = ULONG(machdep->pmd + PAGEOFFSET(pmd_ptr));
|
|
|
|
pmd_val = ULONG(machdep->pmd + PAGEOFFSET(pmd_ptr));
|
|
|
|
@@ -1360,7 +1182,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
@@ -1365,7 +1187,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
goto no_page;
|
|
|
|
goto no_page;
|
|
|
|
|
|
|
|
|
|
|
|
if ((pmd_val & PMD_TYPE_MASK) == PMD_TYPE_SECT) {
|
|
|
|
if ((pmd_val & PMD_TYPE_MASK) == PMD_TYPE_SECT) {
|
|
|
@ -479,7 +482,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
if (verbose) {
|
|
|
|
if (verbose) {
|
|
|
|
fprintf(fp, " PAGE: %lx (512MB)\n\n", sectionbase);
|
|
|
|
fprintf(fp, " PAGE: %lx (512MB)\n\n", sectionbase);
|
|
|
|
arm64_translate_pte(pmd_val, 0, 0);
|
|
|
|
arm64_translate_pte(pmd_val, 0, 0);
|
|
|
|
@@ -1369,7 +1191,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
@@ -1374,7 +1196,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
return TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -488,7 +491,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
FILL_PTBL(pte_base, KVADDR, PTRS_PER_PTE_L3_64K * sizeof(ulong));
|
|
|
|
FILL_PTBL(pte_base, KVADDR, PTRS_PER_PTE_L3_64K * sizeof(ulong));
|
|
|
|
pte_ptr = pte_base + (((vaddr) >> machdep->pageshift) & (PTRS_PER_PTE_L3_64K - 1));
|
|
|
|
pte_ptr = pte_base + (((vaddr) >> machdep->pageshift) & (PTRS_PER_PTE_L3_64K - 1));
|
|
|
|
pte_val = ULONG(machdep->ptbl + PAGEOFFSET(pte_ptr));
|
|
|
|
pte_val = ULONG(machdep->ptbl + PAGEOFFSET(pte_ptr));
|
|
|
|
@@ -1379,7 +1201,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
@@ -1384,7 +1206,7 @@ arm64_vtop_3level_64k(ulong pgd, ulong vaddr, physaddr_t *paddr, int verbose)
|
|
|
|
goto no_page;
|
|
|
|
goto no_page;
|
|
|
|
|
|
|
|
|
|
|
|
if (pte_val & PTE_VALID) {
|
|
|
|
if (pte_val & PTE_VALID) {
|
|
|
@ -497,7 +500,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
if (verbose) {
|
|
|
|
if (verbose) {
|
|
|
|
fprintf(fp, " PAGE: %lx\n\n", PAGEBASE(*paddr));
|
|
|
|
fprintf(fp, " PAGE: %lx\n\n", PAGEBASE(*paddr));
|
|
|
|
arm64_translate_pte(pte_val, 0, 0);
|
|
|
|
arm64_translate_pte(pte_val, 0, 0);
|
|
|
|
@@ -1682,11 +1504,10 @@ arm64_stackframe_init(void)
|
|
|
|
@@ -1696,11 +1518,10 @@ arm64_stackframe_init(void)
|
|
|
|
machdep->machspec->kern_eframe_offset = SIZE(pt_regs);
|
|
|
|
machdep->machspec->kern_eframe_offset = SIZE(pt_regs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -513,7 +516,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
if ((sp1 = kernel_symbol_search("__irqentry_text_start")) &&
|
|
|
|
if ((sp1 = kernel_symbol_search("__irqentry_text_start")) &&
|
|
|
|
(sp2 = kernel_symbol_search("__irqentry_text_end"))) {
|
|
|
|
(sp2 = kernel_symbol_search("__irqentry_text_end"))) {
|
|
|
|
machdep->machspec->__irqentry_text_start = sp1->value;
|
|
|
|
machdep->machspec->__irqentry_text_start = sp1->value;
|
|
|
|
@@ -1812,14 +1633,13 @@ static int
|
|
|
|
@@ -1826,14 +1647,13 @@ static int
|
|
|
|
arm64_is_kernel_exception_frame(struct bt_info *bt, ulong stkptr)
|
|
|
|
arm64_is_kernel_exception_frame(struct bt_info *bt, ulong stkptr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct arm64_pt_regs *regs;
|
|
|
|
struct arm64_pt_regs *regs;
|
|
|
@ -529,7 +532,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
switch (regs->pstate & PSR_MODE_MASK)
|
|
|
|
switch (regs->pstate & PSR_MODE_MASK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case PSR_MODE_EL1t:
|
|
|
|
case PSR_MODE_EL1t:
|
|
|
|
@@ -1896,38 +1716,20 @@ arm64_eframe_search(struct bt_info *bt)
|
|
|
|
@@ -1910,38 +1730,20 @@ arm64_eframe_search(struct bt_info *bt)
|
|
|
|
return count;
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -572,7 +575,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1963,7 +1765,6 @@ arm64_print_stackframe_entry(struct bt_info *bt, int level, struct arm64_stackfr
|
|
|
|
@@ -1977,7 +1779,6 @@ arm64_print_stackframe_entry(struct bt_info *bt, int level, struct arm64_stackfr
|
|
|
|
* See, for example, "bl schedule" before ret_to_user().
|
|
|
|
* See, for example, "bl schedule" before ret_to_user().
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
branch_pc = frame->pc - 4;
|
|
|
|
branch_pc = frame->pc - 4;
|
|
|
@ -580,7 +583,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
name = closest_symbol(branch_pc);
|
|
|
|
name = closest_symbol(branch_pc);
|
|
|
|
name_plus_offset = NULL;
|
|
|
|
name_plus_offset = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2175,7 +1976,7 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
|
|
|
|
@@ -2189,7 +1990,7 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
|
|
|
|
unsigned long stack_mask;
|
|
|
|
unsigned long stack_mask;
|
|
|
|
unsigned long irq_stack_ptr, orig_sp;
|
|
|
|
unsigned long irq_stack_ptr, orig_sp;
|
|
|
|
struct arm64_pt_regs *ptregs;
|
|
|
|
struct arm64_pt_regs *ptregs;
|
|
|
@ -589,7 +592,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
stack_mask = (unsigned long)(ARM64_STACK_SIZE) - 1;
|
|
|
|
stack_mask = (unsigned long)(ARM64_STACK_SIZE) - 1;
|
|
|
|
fp = frame->fp;
|
|
|
|
fp = frame->fp;
|
|
|
|
@@ -2189,8 +1990,6 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
|
|
|
|
@@ -2203,8 +2004,6 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
|
|
|
|
frame->sp = fp + 0x10;
|
|
|
|
frame->sp = fp + 0x10;
|
|
|
|
frame->fp = GET_STACK_ULONG(fp);
|
|
|
|
frame->fp = GET_STACK_ULONG(fp);
|
|
|
|
frame->pc = GET_STACK_ULONG(fp + 8);
|
|
|
|
frame->pc = GET_STACK_ULONG(fp + 8);
|
|
|
@ -598,7 +601,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
if ((frame->fp == 0) && (frame->pc == 0))
|
|
|
|
if ((frame->fp == 0) && (frame->pc == 0))
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
@@ -2242,6 +2041,7 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
|
|
|
|
@@ -2256,6 +2055,7 @@ arm64_unwind_frame(struct bt_info *bt, struct arm64_stackframe *frame)
|
|
|
|
* irq_stack_ptr = IRQ_STACK_PTR(raw_smp_processor_id());
|
|
|
|
* irq_stack_ptr = IRQ_STACK_PTR(raw_smp_processor_id());
|
|
|
|
* orig_sp = IRQ_STACK_TO_TASK_STACK(irq_stack_ptr); (pt_regs pointer on process stack)
|
|
|
|
* orig_sp = IRQ_STACK_TO_TASK_STACK(irq_stack_ptr); (pt_regs pointer on process stack)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -606,7 +609,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
irq_stack_ptr = ms->irq_stacks[bt->tc->processor] + ms->irq_stack_size - 16;
|
|
|
|
irq_stack_ptr = ms->irq_stacks[bt->tc->processor] + ms->irq_stack_size - 16;
|
|
|
|
|
|
|
|
|
|
|
|
if (frame->sp == irq_stack_ptr) {
|
|
|
|
if (frame->sp == irq_stack_ptr) {
|
|
|
|
@@ -2843,8 +2643,6 @@ arm64_print_text_symbols(struct bt_info *bt, struct arm64_stackframe *frame, FIL
|
|
|
|
@@ -2857,8 +2657,6 @@ arm64_print_text_symbols(struct bt_info *bt, struct arm64_stackframe *frame, FIL
|
|
|
|
char buf2[BUFSIZE];
|
|
|
|
char buf2[BUFSIZE];
|
|
|
|
char *name;
|
|
|
|
char *name;
|
|
|
|
ulong start;
|
|
|
|
ulong start;
|
|
|
@ -615,7 +618,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
if (bt->flags & BT_TEXT_SYMBOLS_ALL)
|
|
|
|
if (bt->flags & BT_TEXT_SYMBOLS_ALL)
|
|
|
|
start = bt->stackbase;
|
|
|
|
start = bt->stackbase;
|
|
|
|
@@ -2859,10 +2657,8 @@ arm64_print_text_symbols(struct bt_info *bt, struct arm64_stackframe *frame, FIL
|
|
|
|
@@ -2873,10 +2671,8 @@ arm64_print_text_symbols(struct bt_info *bt, struct arm64_stackframe *frame, FIL
|
|
|
|
|
|
|
|
|
|
|
|
for (i = (start - bt->stackbase)/sizeof(ulong); i < LONGS_PER_STACK; i++) {
|
|
|
|
for (i = (start - bt->stackbase)/sizeof(ulong); i < LONGS_PER_STACK; i++) {
|
|
|
|
up = (ulong *)(&bt->stackbuf[i*sizeof(ulong)]);
|
|
|
|
up = (ulong *)(&bt->stackbuf[i*sizeof(ulong)]);
|
|
|
@ -628,7 +631,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
fprintf(ofp, " %s[%s] %s at %lx",
|
|
|
|
fprintf(ofp, " %s[%s] %s at %lx",
|
|
|
|
bt->flags & BT_ERROR_MASK ?
|
|
|
|
bt->flags & BT_ERROR_MASK ?
|
|
|
|
" " : "",
|
|
|
|
" " : "",
|
|
|
|
@@ -2871,13 +2667,13 @@ arm64_print_text_symbols(struct bt_info *bt, struct arm64_stackframe *frame, FIL
|
|
|
|
@@ -2885,13 +2681,13 @@ arm64_print_text_symbols(struct bt_info *bt, struct arm64_stackframe *frame, FIL
|
|
|
|
MKSTR(bt->stackbase +
|
|
|
|
MKSTR(bt->stackbase +
|
|
|
|
(i * sizeof(long)))),
|
|
|
|
(i * sizeof(long)))),
|
|
|
|
bt->flags & BT_SYMBOL_OFFSET ?
|
|
|
|
bt->flags & BT_SYMBOL_OFFSET ?
|
|
|
@ -646,7 +649,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -3180,7 +2976,6 @@ arm64_print_exception_frame(struct bt_info *bt, ulong pt_regs, int mode, FILE *o
|
|
|
|
@@ -3194,7 +2990,6 @@ arm64_print_exception_frame(struct bt_info *bt, ulong pt_regs, int mode, FILE *o
|
|
|
|
struct syment *sp;
|
|
|
|
struct syment *sp;
|
|
|
|
ulong LR, SP, offset;
|
|
|
|
ulong LR, SP, offset;
|
|
|
|
char buf[BUFSIZE];
|
|
|
|
char buf[BUFSIZE];
|
|
|
@ -654,7 +657,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
if (CRASHDEBUG(1))
|
|
|
|
if (CRASHDEBUG(1))
|
|
|
|
fprintf(ofp, "pt_regs: %lx\n", pt_regs);
|
|
|
|
fprintf(ofp, "pt_regs: %lx\n", pt_regs);
|
|
|
|
@@ -3196,8 +2991,6 @@ arm64_print_exception_frame(struct bt_info *bt, ulong pt_regs, int mode, FILE *o
|
|
|
|
@@ -3210,8 +3005,6 @@ arm64_print_exception_frame(struct bt_info *bt, ulong pt_regs, int mode, FILE *o
|
|
|
|
rows = 4;
|
|
|
|
rows = 4;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
LR = regs->regs[30];
|
|
|
|
LR = regs->regs[30];
|
|
|
@ -663,7 +666,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
SP = regs->sp;
|
|
|
|
SP = regs->sp;
|
|
|
|
top_reg = 29;
|
|
|
|
top_reg = 29;
|
|
|
|
is_64_bit = TRUE;
|
|
|
|
is_64_bit = TRUE;
|
|
|
|
@@ -3345,7 +3138,7 @@ arm64_translate_pte(ulong pte, void *physaddr, ulonglong unused)
|
|
|
|
@@ -3359,7 +3152,7 @@ arm64_translate_pte(ulong pte, void *physaddr, ulonglong unused)
|
|
|
|
char *arglist[MAXARGS];
|
|
|
|
char *arglist[MAXARGS];
|
|
|
|
int page_present;
|
|
|
|
int page_present;
|
|
|
|
|
|
|
|
|
|
|
@ -672,7 +675,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
page_present = pte & (PTE_VALID | machdep->machspec->PTE_PROT_NONE);
|
|
|
|
page_present = pte & (PTE_VALID | machdep->machspec->PTE_PROT_NONE);
|
|
|
|
|
|
|
|
|
|
|
|
if (physaddr) {
|
|
|
|
if (physaddr) {
|
|
|
|
@@ -3611,8 +3404,8 @@ arm64_display_machine_stats(void)
|
|
|
|
@@ -3625,8 +3418,8 @@ arm64_display_machine_stats(void)
|
|
|
|
fprintf(fp, " HZ: %d\n", machdep->hz);
|
|
|
|
fprintf(fp, " HZ: %d\n", machdep->hz);
|
|
|
|
fprintf(fp, " PAGE SIZE: %d\n", PAGESIZE());
|
|
|
|
fprintf(fp, " PAGE SIZE: %d\n", PAGESIZE());
|
|
|
|
fprintf(fp, "KERNEL VIRTUAL BASE: %lx\n", machdep->machspec->page_offset);
|
|
|
|
fprintf(fp, "KERNEL VIRTUAL BASE: %lx\n", machdep->machspec->page_offset);
|
|
|
@ -682,7 +685,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
fprintf(fp, "KERNEL VMEMMAP BASE: %lx\n", machdep->machspec->vmemmap_vaddr);
|
|
|
|
fprintf(fp, "KERNEL VMEMMAP BASE: %lx\n", machdep->machspec->vmemmap_vaddr);
|
|
|
|
fprintf(fp, " KERNEL STACK SIZE: %ld\n", STACKSIZE());
|
|
|
|
fprintf(fp, " KERNEL STACK SIZE: %ld\n", STACKSIZE());
|
|
|
|
if (machdep->machspec->irq_stack_size) {
|
|
|
|
if (machdep->machspec->irq_stack_size) {
|
|
|
|
@@ -3642,7 +3435,7 @@ arm64_get_smp_cpus(void)
|
|
|
|
@@ -3656,7 +3449,7 @@ arm64_get_smp_cpus(void)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Retrieve task registers for the time of the crash.
|
|
|
|
* Retrieve task registers for the time of the crash.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -691,7 +694,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
arm64_get_crash_notes(void)
|
|
|
|
arm64_get_crash_notes(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct machine_specific *ms = machdep->machspec;
|
|
|
|
struct machine_specific *ms = machdep->machspec;
|
|
|
|
@@ -3651,10 +3444,10 @@ arm64_get_crash_notes(void)
|
|
|
|
@@ -3665,10 +3458,10 @@ arm64_get_crash_notes(void)
|
|
|
|
ulong offset;
|
|
|
|
ulong offset;
|
|
|
|
char *buf, *p;
|
|
|
|
char *buf, *p;
|
|
|
|
ulong *notes_ptrs;
|
|
|
|
ulong *notes_ptrs;
|
|
|
@ -704,7 +707,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
crash_notes = symbol_value("crash_notes");
|
|
|
|
crash_notes = symbol_value("crash_notes");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3666,9 +3459,9 @@ arm64_get_crash_notes(void)
|
|
|
|
@@ -3680,9 +3473,9 @@ arm64_get_crash_notes(void)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (!readmem(crash_notes, KVADDR, ¬es_ptrs[kt->cpus-1],
|
|
|
|
if (!readmem(crash_notes, KVADDR, ¬es_ptrs[kt->cpus-1],
|
|
|
|
sizeof(notes_ptrs[kt->cpus-1]), "crash_notes", RETURN_ON_ERROR)) {
|
|
|
|
sizeof(notes_ptrs[kt->cpus-1]), "crash_notes", RETURN_ON_ERROR)) {
|
|
|
@ -716,7 +719,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (symbol_exists("__per_cpu_offset")) {
|
|
|
|
if (symbol_exists("__per_cpu_offset")) {
|
|
|
|
@@ -3684,11 +3477,12 @@ arm64_get_crash_notes(void)
|
|
|
|
@@ -3698,11 +3491,12 @@ arm64_get_crash_notes(void)
|
|
|
|
if (!(ms->panic_task_regs = calloc((size_t)kt->cpus, sizeof(struct arm64_pt_regs))))
|
|
|
|
if (!(ms->panic_task_regs = calloc((size_t)kt->cpus, sizeof(struct arm64_pt_regs))))
|
|
|
|
error(FATAL, "cannot calloc panic_task_regs space\n");
|
|
|
|
error(FATAL, "cannot calloc panic_task_regs space\n");
|
|
|
|
|
|
|
|
|
|
|
@ -732,7 +735,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
@@ -3718,24 +3512,19 @@ arm64_get_crash_notes(void)
|
|
|
|
@@ -3732,24 +3526,19 @@ arm64_get_crash_notes(void)
|
|
|
|
note->n_descsz == notesz)
|
|
|
|
note->n_descsz == notesz)
|
|
|
|
BCOPY((char *)note, buf, notesz);
|
|
|
|
BCOPY((char *)note, buf, notesz);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -764,7 +767,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
@@ -3748,17 +3537,18 @@ arm64_get_crash_notes(void)
|
|
|
|
@@ -3762,17 +3551,18 @@ arm64_get_crash_notes(void)
|
|
|
|
|
|
|
|
|
|
|
|
BCOPY(p + OFFSET(elf_prstatus_pr_reg), &ms->panic_task_regs[i],
|
|
|
|
BCOPY(p + OFFSET(elf_prstatus_pr_reg), &ms->panic_task_regs[i],
|
|
|
|
sizeof(struct arm64_pt_regs));
|
|
|
|
sizeof(struct arm64_pt_regs));
|
|
|
@ -789,7 +792,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
@@ -3882,13 +3672,9 @@ arm64_IS_VMALLOC_ADDR(ulong vaddr)
|
|
|
|
@@ -3896,13 +3686,9 @@ arm64_IS_VMALLOC_ADDR(ulong vaddr)
|
|
|
|
(vaddr <= machdep->machspec->kimage_end))
|
|
|
|
(vaddr <= machdep->machspec->kimage_end))
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
|
@ -804,7 +807,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
(vaddr >= ms->modules_vaddr && vaddr <= ms->modules_end));
|
|
|
|
(vaddr >= ms->modules_vaddr && vaddr <= ms->modules_end));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3897,57 +3683,9 @@ arm64_calc_VA_BITS(void)
|
|
|
|
@@ -3911,57 +3697,9 @@ arm64_calc_VA_BITS(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int bitval;
|
|
|
|
int bitval;
|
|
|
|
struct syment *sp;
|
|
|
|
struct syment *sp;
|
|
|
@ -863,7 +866,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
if (!(sp = symbol_search("swapper_pg_dir")) &&
|
|
|
|
if (!(sp = symbol_search("swapper_pg_dir")) &&
|
|
|
|
!(sp = symbol_search("idmap_pg_dir")) &&
|
|
|
|
!(sp = symbol_search("idmap_pg_dir")) &&
|
|
|
|
!(sp = symbol_search("_text")) &&
|
|
|
|
!(sp = symbol_search("_text")) &&
|
|
|
|
@@ -3976,12 +3714,14 @@ arm64_calc_VA_BITS(void)
|
|
|
|
@@ -3990,12 +3728,14 @@ arm64_calc_VA_BITS(void)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Verify against dumpfiles that export VA_BITS in vmcoreinfo
|
|
|
|
* Verify against dumpfiles that export VA_BITS in vmcoreinfo
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -884,7 +887,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
if (CRASHDEBUG(1))
|
|
|
|
if (CRASHDEBUG(1))
|
|
|
|
fprintf(fp, "VA_BITS: %ld\n", machdep->machspec->VA_BITS);
|
|
|
|
fprintf(fp, "VA_BITS: %ld\n", machdep->machspec->VA_BITS);
|
|
|
|
@@ -3999,15 +3739,6 @@ arm64_calc_VA_BITS(void)
|
|
|
|
@@ -4013,15 +3753,6 @@ arm64_calc_VA_BITS(void)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Since VMEMMAP_SIZE is dependent upon the size of a struct page,
|
|
|
|
* Since VMEMMAP_SIZE is dependent upon the size of a struct page,
|
|
|
|
* the two ranges cannot be determined until POST_GDB.
|
|
|
|
* the two ranges cannot be determined until POST_GDB.
|
|
|
@ -900,7 +903,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
|
|
|
|
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
|
|
|
|
@@ -4019,23 +3750,10 @@ static void
|
|
|
|
@@ -4033,23 +3764,10 @@ static void
|
|
|
|
arm64_calc_virtual_memory_ranges(void)
|
|
|
|
arm64_calc_virtual_memory_ranges(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct machine_specific *ms = machdep->machspec;
|
|
|
|
struct machine_specific *ms = machdep->machspec;
|
|
|
@ -926,7 +929,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
if (THIS_KERNEL_VERSION < LINUX(3,17,0)) /* use original hardwired values */
|
|
|
|
if (THIS_KERNEL_VERSION < LINUX(3,17,0)) /* use original hardwired values */
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4054,24 +3772,8 @@ arm64_calc_virtual_memory_ranges(void)
|
|
|
|
@@ -4068,24 +3786,8 @@ arm64_calc_virtual_memory_ranges(void)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -952,7 +955,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
vmemmap_size = 1UL << (ms->VA_BITS - machdep->pageshift - 1
|
|
|
|
vmemmap_size = 1UL << (ms->VA_BITS - machdep->pageshift - 1
|
|
|
|
+ STRUCT_PAGE_MAX_SHIFT);
|
|
|
|
+ STRUCT_PAGE_MAX_SHIFT);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
@@ -4095,7 +3797,7 @@ arm64_calc_virtual_memory_ranges(void)
|
|
|
|
@@ -4109,7 +3811,7 @@ arm64_calc_virtual_memory_ranges(void)
|
|
|
|
static int
|
|
|
|
static int
|
|
|
|
arm64_is_uvaddr(ulong addr, struct task_context *tc)
|
|
|
|
arm64_is_uvaddr(ulong addr, struct task_context *tc)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -961,7 +964,7 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4120,20 +3822,6 @@ arm64_swp_offset(ulong pte)
|
|
|
|
@@ -4134,20 +3836,6 @@ arm64_swp_offset(ulong pte)
|
|
|
|
return pte;
|
|
|
|
return pte;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -983,10 +986,10 @@ index fdf77bd5e0c1..6d825c9e67de 100644
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/defs.h b/defs.h
|
|
|
|
diff --git a/defs.h b/defs.h
|
|
|
|
index 95949507cae4..48f5e05e32f3 100644
|
|
|
|
index 396d61aaf532..897386160abd 100644
|
|
|
|
--- a/defs.h
|
|
|
|
--- a/defs.h
|
|
|
|
+++ b/defs.h
|
|
|
|
+++ b/defs.h
|
|
|
|
@@ -3052,7 +3052,7 @@ typedef u64 pte_t;
|
|
|
|
@@ -3087,7 +3087,7 @@ typedef u64 pte_t;
|
|
|
|
#define MACHINE_TYPE "ARM64"
|
|
|
|
#define MACHINE_TYPE "ARM64"
|
|
|
|
|
|
|
|
|
|
|
|
#define PTOV(X) \
|
|
|
|
#define PTOV(X) \
|
|
|
@ -995,7 +998,7 @@ index 95949507cae4..48f5e05e32f3 100644
|
|
|
|
|
|
|
|
|
|
|
|
#define VTOP(X) arm64_VTOP((ulong)(X))
|
|
|
|
#define VTOP(X) arm64_VTOP((ulong)(X))
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3186,17 +3186,9 @@ typedef signed int s32;
|
|
|
|
@@ -3221,17 +3221,9 @@ typedef signed int s32;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define ARM64_VA_START ((0xffffffffffffffffUL) \
|
|
|
|
#define ARM64_VA_START ((0xffffffffffffffffUL) \
|
|
|
|
<< machdep->machspec->VA_BITS)
|
|
|
|
<< machdep->machspec->VA_BITS)
|
|
|
@ -1013,7 +1016,7 @@ index 95949507cae4..48f5e05e32f3 100644
|
|
|
|
|
|
|
|
|
|
|
|
/* only used for v4.6 or later */
|
|
|
|
/* only used for v4.6 or later */
|
|
|
|
#define ARM64_MODULES_VSIZE MEGABYTES(128)
|
|
|
|
#define ARM64_MODULES_VSIZE MEGABYTES(128)
|
|
|
|
@@ -3299,11 +3291,7 @@ struct machine_specific {
|
|
|
|
@@ -3334,11 +3326,7 @@ struct machine_specific {
|
|
|
|
ulong kern_eframe_offset;
|
|
|
|
ulong kern_eframe_offset;
|
|
|
|
ulong machine_kexec_start;
|
|
|
|
ulong machine_kexec_start;
|
|
|
|
ulong machine_kexec_end;
|
|
|
|
ulong machine_kexec_end;
|
|
|
@ -1026,7 +1029,7 @@ index 95949507cae4..48f5e05e32f3 100644
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct arm64_stackframe {
|
|
|
|
struct arm64_stackframe {
|
|
|
|
@@ -3552,8 +3540,6 @@ struct arm64_stackframe {
|
|
|
|
@@ -3626,8 +3614,6 @@ struct arm64_stackframe {
|
|
|
|
machdep->machspec->last_p4d_read = (ulong)(P4D); \
|
|
|
|
machdep->machspec->last_p4d_read = (ulong)(P4D); \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1035,3 +1038,6 @@ index 95949507cae4..48f5e05e32f3 100644
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* PHYSICAL_PAGE_MASK changed (enlarged) between 2.4 and 2.6, so
|
|
|
|
* PHYSICAL_PAGE_MASK changed (enlarged) between 2.4 and 2.6, so
|
|
|
|
* for safety, use the 2.6 values to generate it.
|
|
|
|
* for safety, use the 2.6 values to generate it.
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
2.17.1
|
|
|
|
|
|
|
|
|
|
|
|