Commit 00ae36de authored by Anton Blanchard's avatar Anton Blanchard Committed by Paul Mackerras

[POWERPC] Better check in show_instructions

Instead of just checking that an address is in the right range, use the
provided __kernel_text_address() helper which covers both the kernel and
module text sections.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 99f48610
...@@ -341,13 +341,6 @@ struct task_struct *__switch_to(struct task_struct *prev, ...@@ -341,13 +341,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
static int instructions_to_print = 16; static int instructions_to_print = 16;
#ifdef CONFIG_PPC64
#define BAD_PC(pc) ((REGION_ID(pc) != KERNEL_REGION_ID) && \
(REGION_ID(pc) != VMALLOC_REGION_ID))
#else
#define BAD_PC(pc) ((pc) < KERNELBASE)
#endif
static void show_instructions(struct pt_regs *regs) static void show_instructions(struct pt_regs *regs)
{ {
int i; int i;
...@@ -366,7 +359,8 @@ static void show_instructions(struct pt_regs *regs) ...@@ -366,7 +359,8 @@ static void show_instructions(struct pt_regs *regs)
* bad address because the pc *should* only be a * bad address because the pc *should* only be a
* kernel address. * kernel address.
*/ */
if (BAD_PC(pc) || __get_user(instr, (unsigned int __user *)pc)) { if (!__kernel_text_address(pc) ||
__get_user(instr, (unsigned int __user *)pc)) {
printk("XXXXXXXX "); printk("XXXXXXXX ");
} else { } else {
if (regs->nip == pc) if (regs->nip == pc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment