arch/powerpc: use printk_ratelimited instead of printk_ratelimit
Since printk_ratelimit() shouldn't be used anymore (see comment in include/linux/printk.h), replace it with printk_ratelimited. Signed-off-by: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
9a8f99fab0
commit
76462232c2
@@ -25,6 +25,7 @@
|
|||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/elf.h>
|
#include <linux/elf.h>
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
#ifdef CONFIG_PPC64
|
#ifdef CONFIG_PPC64
|
||||||
#include <linux/syscalls.h>
|
#include <linux/syscalls.h>
|
||||||
#include <linux/compat.h>
|
#include <linux/compat.h>
|
||||||
@@ -892,8 +893,9 @@ badframe:
|
|||||||
printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
|
printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
|
||||||
regs, frame, newsp);
|
regs, frame, newsp);
|
||||||
#endif
|
#endif
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32: "
|
printk_ratelimited(KERN_INFO
|
||||||
|
"%s[%d]: bad frame in handle_rt_signal32: "
|
||||||
"%p nip %08lx lr %08lx\n",
|
"%p nip %08lx lr %08lx\n",
|
||||||
current->comm, current->pid,
|
current->comm, current->pid,
|
||||||
addr, regs->nip, regs->link);
|
addr, regs->nip, regs->link);
|
||||||
@@ -1058,8 +1060,9 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(KERN_INFO "%s[%d]: bad frame in sys_rt_sigreturn: "
|
printk_ratelimited(KERN_INFO
|
||||||
|
"%s[%d]: bad frame in sys_rt_sigreturn: "
|
||||||
"%p nip %08lx lr %08lx\n",
|
"%p nip %08lx lr %08lx\n",
|
||||||
current->comm, current->pid,
|
current->comm, current->pid,
|
||||||
rt_sf, regs->nip, regs->link);
|
rt_sf, regs->nip, regs->link);
|
||||||
@@ -1149,8 +1152,8 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
|
|||||||
* We kill the task with a SIGSEGV in this situation.
|
* We kill the task with a SIGSEGV in this situation.
|
||||||
*/
|
*/
|
||||||
if (do_setcontext(ctx, regs, 1)) {
|
if (do_setcontext(ctx, regs, 1)) {
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(KERN_INFO "%s[%d]: bad frame in "
|
printk_ratelimited(KERN_INFO "%s[%d]: bad frame in "
|
||||||
"sys_debug_setcontext: %p nip %08lx "
|
"sys_debug_setcontext: %p nip %08lx "
|
||||||
"lr %08lx\n",
|
"lr %08lx\n",
|
||||||
current->comm, current->pid,
|
current->comm, current->pid,
|
||||||
@@ -1236,8 +1239,9 @@ badframe:
|
|||||||
printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
|
printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
|
||||||
regs, frame, newsp);
|
regs, frame, newsp);
|
||||||
#endif
|
#endif
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(KERN_INFO "%s[%d]: bad frame in handle_signal32: "
|
printk_ratelimited(KERN_INFO
|
||||||
|
"%s[%d]: bad frame in handle_signal32: "
|
||||||
"%p nip %08lx lr %08lx\n",
|
"%p nip %08lx lr %08lx\n",
|
||||||
current->comm, current->pid,
|
current->comm, current->pid,
|
||||||
frame, regs->nip, regs->link);
|
frame, regs->nip, regs->link);
|
||||||
@@ -1288,8 +1292,9 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
badframe:
|
badframe:
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(KERN_INFO "%s[%d]: bad frame in sys_sigreturn: "
|
printk_ratelimited(KERN_INFO
|
||||||
|
"%s[%d]: bad frame in sys_sigreturn: "
|
||||||
"%p nip %08lx lr %08lx\n",
|
"%p nip %08lx lr %08lx\n",
|
||||||
current->comm, current->pid,
|
current->comm, current->pid,
|
||||||
addr, regs->nip, regs->link);
|
addr, regs->nip, regs->link);
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include <linux/elf.h>
|
#include <linux/elf.h>
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
|
|
||||||
#include <asm/sigcontext.h>
|
#include <asm/sigcontext.h>
|
||||||
#include <asm/ucontext.h>
|
#include <asm/ucontext.h>
|
||||||
@@ -380,8 +381,8 @@ badframe:
|
|||||||
printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
|
printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
|
||||||
regs, uc, &uc->uc_mcontext);
|
regs, uc, &uc->uc_mcontext);
|
||||||
#endif
|
#endif
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
|
printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
|
||||||
current->comm, current->pid, "rt_sigreturn",
|
current->comm, current->pid, "rt_sigreturn",
|
||||||
(long)uc, regs->nip, regs->link);
|
(long)uc, regs->nip, regs->link);
|
||||||
|
|
||||||
@@ -468,8 +469,8 @@ badframe:
|
|||||||
printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
|
printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
|
||||||
regs, frame, newsp);
|
regs, frame, newsp);
|
||||||
#endif
|
#endif
|
||||||
if (show_unhandled_signals && printk_ratelimit())
|
if (show_unhandled_signals)
|
||||||
printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
|
printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
|
||||||
current->comm, current->pid, "setup_rt_frame",
|
current->comm, current->pid, "setup_rt_frame",
|
||||||
(long)frame, regs->nip, regs->link);
|
(long)frame, regs->nip, regs->link);
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include <linux/bug.h>
|
#include <linux/bug.h>
|
||||||
#include <linux/kdebug.h>
|
#include <linux/kdebug.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
|
|
||||||
#include <asm/emulated_ops.h>
|
#include <asm/emulated_ops.h>
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
@@ -197,9 +198,8 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
|
|||||||
if (die("Exception in kernel mode", regs, signr))
|
if (die("Exception in kernel mode", regs, signr))
|
||||||
return;
|
return;
|
||||||
} else if (show_unhandled_signals &&
|
} else if (show_unhandled_signals &&
|
||||||
unhandled_signal(current, signr) &&
|
unhandled_signal(current, signr)) {
|
||||||
printk_ratelimit()) {
|
printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
|
||||||
printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
|
|
||||||
current->comm, current->pid, signr,
|
current->comm, current->pid, signr,
|
||||||
addr, regs->nip, regs->link, code);
|
addr, regs->nip, regs->link, code);
|
||||||
}
|
}
|
||||||
@@ -1342,8 +1342,7 @@ void altivec_assist_exception(struct pt_regs *regs)
|
|||||||
} else {
|
} else {
|
||||||
/* didn't recognize the instruction */
|
/* didn't recognize the instruction */
|
||||||
/* XXX quick hack for now: set the non-Java bit in the VSCR */
|
/* XXX quick hack for now: set the non-Java bit in the VSCR */
|
||||||
if (printk_ratelimit())
|
printk_ratelimited(KERN_ERR "Unrecognized altivec instruction "
|
||||||
printk(KERN_ERR "Unrecognized altivec instruction "
|
|
||||||
"in %s at %lx\n", current->comm, regs->nip);
|
"in %s at %lx\n", current->comm, regs->nip);
|
||||||
current->thread.vscr.u[3] |= 0x10000;
|
current->thread.vscr.u[3] |= 0x10000;
|
||||||
}
|
}
|
||||||
@@ -1548,8 +1547,7 @@ u32 ppc_warn_emulated;
|
|||||||
|
|
||||||
void ppc_warn_emulated_print(const char *type)
|
void ppc_warn_emulated_print(const char *type)
|
||||||
{
|
{
|
||||||
if (printk_ratelimit())
|
pr_warn_ratelimited("%s used emulated %s instruction\n", current->comm,
|
||||||
pr_warning("%s used emulated %s instruction\n", current->comm,
|
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include <linux/kdebug.h>
|
#include <linux/kdebug.h>
|
||||||
#include <linux/perf_event.h>
|
#include <linux/perf_event.h>
|
||||||
#include <linux/magic.h>
|
#include <linux/magic.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
|
|
||||||
#include <asm/firmware.h>
|
#include <asm/firmware.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
@@ -346,9 +347,8 @@ bad_area_nosemaphore:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_exec && (error_code & DSISR_PROTFAULT)
|
if (is_exec && (error_code & DSISR_PROTFAULT))
|
||||||
&& printk_ratelimit())
|
printk_ratelimited(KERN_CRIT "kernel tried to execute NX-protected"
|
||||||
printk(KERN_CRIT "kernel tried to execute NX-protected"
|
|
||||||
" page (%lx) - exploit attempt? (uid: %d)\n",
|
" page (%lx) - exploit attempt? (uid: %d)\n",
|
||||||
address, current_uid());
|
address, current_uid());
|
||||||
|
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/syscore_ops.h>
|
#include <linux/syscore_ops.h>
|
||||||
|
#include <linux/ratelimit.h>
|
||||||
|
|
||||||
#include <asm/ptrace.h>
|
#include <asm/ptrace.h>
|
||||||
#include <asm/signal.h>
|
#include <asm/signal.h>
|
||||||
@@ -1648,8 +1649,7 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
|
|||||||
return NO_IRQ;
|
return NO_IRQ;
|
||||||
}
|
}
|
||||||
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
|
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
|
||||||
if (printk_ratelimit())
|
printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
|
||||||
printk(KERN_WARNING "%s: Got protected source %d !\n",
|
|
||||||
mpic->name, (int)src);
|
mpic->name, (int)src);
|
||||||
mpic_eoi(mpic);
|
mpic_eoi(mpic);
|
||||||
return NO_IRQ;
|
return NO_IRQ;
|
||||||
@@ -1688,8 +1688,7 @@ unsigned int mpic_get_coreint_irq(void)
|
|||||||
return NO_IRQ;
|
return NO_IRQ;
|
||||||
}
|
}
|
||||||
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
|
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
|
||||||
if (printk_ratelimit())
|
printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
|
||||||
printk(KERN_WARNING "%s: Got protected source %d !\n",
|
|
||||||
mpic->name, (int)src);
|
mpic->name, (int)src);
|
||||||
return NO_IRQ;
|
return NO_IRQ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user