KVM: arm64: Sanely ratelimit sysreg messages
authorMark Rutland <mark.rutland@arm.com>
Thu, 5 Dec 2019 18:06:51 +0000 (18:06 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 6 Dec 2019 11:41:45 +0000 (11:41 +0000)
commitbf4b96bb542ee3fe913d0b9eb4d9c1046c429ac6
treeec0b50ee91c90997b90e03430b2cf67418057ec1
parent72a610f32e1f1664803218ec654a8e3b8fb2081a
KVM: arm64: Sanely ratelimit sysreg messages

Currently kvm_pr_unimpl() is ratelimited, so print_sys_reg_instr() won't
spam the console. However, someof its callers try to print some
contextual information with kvm_err(), which is not ratelimited. This
means that in some cases the context may be printed without the sysreg
encoding, which isn't all that useful.

Let's ensure that both are consistently printed together and
ratelimited, by refactoring print_sys_reg_instr() so that some callers
can provide it with an arbitrary format string.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20191205180652.18671-2-mark.rutland@arm.com
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/sys_regs.h