mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
vmap: print pfn for register in vmalloc range [1/1]
PD#SWPL-5564 Problem: When open VMAP for kernel stack, if we meet kernel panic log, we can't know physical address of stack and hard to debug. Solution: Print pfn for register in vmalloc range Verify: p212 Change-Id: Iee120df1feab88e412ef63e87c2e2bb4ad0645fb Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
This commit is contained in:
@@ -382,6 +382,23 @@ done:
|
||||
pr_cont("%s", name);
|
||||
pr_cont("\n");
|
||||
}
|
||||
|
||||
static void show_vmalloc_pfn(struct pt_regs *regs)
|
||||
{
|
||||
int i;
|
||||
struct page *page;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (is_vmalloc_or_module_addr((void *)regs->uregs[i])) {
|
||||
page = vmalloc_to_page((void *)regs->uregs[i]);
|
||||
if (!page)
|
||||
continue;
|
||||
pr_info("R%-2d : %08lx, PFN:%5lx\n",
|
||||
i, regs->uregs[i], page_to_pfn(page));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* CONFIG_AMLOGIC_USER_FAULT */
|
||||
|
||||
void __show_regs(struct pt_regs *regs)
|
||||
@@ -440,6 +457,10 @@ void __show_regs(struct pt_regs *regs)
|
||||
buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
|
||||
buf[4] = '\0';
|
||||
|
||||
#ifdef CONFIG_AMLOGIC_USER_FAULT
|
||||
show_vmalloc_pfn(regs);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CPU_V7M
|
||||
{
|
||||
const char *segment;
|
||||
|
||||
@@ -293,6 +293,23 @@ static void show_user_data(unsigned long addr, int nbytes, const char *name)
|
||||
pr_cont("\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void show_vmalloc_pfn(struct pt_regs *regs)
|
||||
{
|
||||
int i;
|
||||
struct page *page;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (is_vmalloc_or_module_addr((void *)regs->regs[i])) {
|
||||
page = vmalloc_to_page((void *)regs->regs[i]);
|
||||
if (!page)
|
||||
continue;
|
||||
pr_info("R%-2d : %016llx, PFN:%5lx\n",
|
||||
i, regs->regs[i], page_to_pfn(page));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* CONFIG_AMLOGIC_USER_FAULT */
|
||||
|
||||
static void show_extra_register_data(struct pt_regs *regs, int nbytes)
|
||||
@@ -468,6 +485,7 @@ void __show_regs(struct pt_regs *regs)
|
||||
show_vma(current->mm, instruction_pointer(regs));
|
||||
show_vma(current->mm, lr);
|
||||
}
|
||||
show_vmalloc_pfn(regs);
|
||||
#endif /* CONFIG_AMLOGIC_USER_FAULT */
|
||||
printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n",
|
||||
regs->pc, lr, regs->pstate);
|
||||
|
||||
Reference in New Issue
Block a user