* [PATCH AUTOSEL 4.19 5/9] KVM: x86: degrade WARN to pr_warn_ratelimited
[not found] <20190710150301.7129-1-sashal@kernel.org>
@ 2019-07-10 15:02 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2019-07-10 15:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Paolo Bonzini, syzbot+c03f30b4f4c46bdf8575, Alexander Potapenko,
Sasha Levin, kvm
From: Paolo Bonzini <pbonzini@redhat.com>
[ Upstream commit 3f16a5c318392cbb5a0c7a3d19dff8c8ef3c38ee ]
This warning can be triggered easily by userspace, so it should certainly not
cause a panic if panic_on_warn is set.
Reported-by: syzbot+c03f30b4f4c46bdf8575@syzkaller.appspotmail.com
Suggested-by: Alexander Potapenko <glider@google.com>
Acked-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/x86.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7fed1d6dd1a1..cea6568667c4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1447,7 +1447,7 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
vcpu->arch.tsc_always_catchup = 1;
return 0;
} else {
- WARN(1, "user requested TSC rate below hardware speed\n");
+ pr_warn_ratelimited("user requested TSC rate below hardware speed\n");
return -1;
}
}
@@ -1457,8 +1457,8 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
user_tsc_khz, tsc_khz);
if (ratio == 0 || ratio >= kvm_max_tsc_scaling_ratio) {
- WARN_ONCE(1, "Invalid TSC scaling ratio - virtual-tsc-khz=%u\n",
- user_tsc_khz);
+ pr_warn_ratelimited("Invalid TSC scaling ratio - virtual-tsc-khz=%u\n",
+ user_tsc_khz);
return -1;
}
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-10 15:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190710150301.7129-1-sashal@kernel.org>
2019-07-10 15:02 ` [PATCH AUTOSEL 4.19 5/9] KVM: x86: degrade WARN to pr_warn_ratelimited Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).