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

Commit ee4ed6fa authored by Michael Neuling's avatar Michael Neuling Committed by Benjamin Herrenschmidt
Browse files

powerpc: Rate-limit users spamming kernel log buffer



The facility unavailable exception can be triggered from userspace by
accessing PMU registers when EBB is not enabled.  This causes the
included pr_err() to run, hence spamming the kernel log buffer.

This avoids this by rate limiting these messages.

Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e9aaac1a
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1379,7 +1379,8 @@ void facility_unavailable_exception(struct pt_regs *regs)
	if (!arch_irq_disabled_regs(regs))
	if (!arch_irq_disabled_regs(regs))
		local_irq_enable();
		local_irq_enable();


	pr_err("%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
	pr_err_ratelimited(
		"%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
		hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);
		hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);


	if (user_mode(regs)) {
	if (user_mode(regs)) {