Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72df9f91 authored by Matt Wagantall's avatar Matt Wagantall
Browse files

arm64: Dump memory surrounding PC, LR and SP registers only



Due to the verbosity of printing, dumping memory regions for all
register when many CPUs are online may contribute to flooded kernel
logs. Spinlock lockups due to the printing have also been seen to
result, compounding the problem due to additional prints.

Change-Id: I7440b2d77f03fd34f36816f549588fa89322ce5f
Signed-off-by: default avatarMatt Wagantall <mattw@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: default avatarAbhimanyu Kapur <abhimany@codeaurora.org>
parent 0847f4ff
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -222,18 +222,12 @@ static void show_data(unsigned long addr, int nbytes, const char *name)
static void show_extra_register_data(struct pt_regs *regs, int nbytes)
{
	mm_segment_t fs;
	unsigned int i;

	fs = get_fs();
	set_fs(KERNEL_DS);
	show_data(regs->pc - nbytes, nbytes * 2, "PC");
	show_data(regs->regs[30] - nbytes, nbytes * 2, "LR");
	show_data(regs->sp - nbytes, nbytes * 2, "SP");
	for (i = 0; i < 30; i++) {
		char name[4];
		snprintf(name, sizeof(name), "X%u", i);
		show_data(regs->regs[i] - nbytes, nbytes * 2, name);
	}
	set_fs(fs);
}

@@ -264,7 +258,7 @@ void __show_regs(struct pt_regs *regs)
			printk("\n");
	}
	if (!user_mode(regs))
		show_extra_register_data(regs, 128);
		show_extra_register_data(regs, 256);
	printk("\n");
}