aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-06-26 08:16:13 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-07-02 13:02:44 -0400
commit3f16a5c318392cbb5a0c7a3d19dff8c8ef3c38ee (patch)
treec531c40fc27d078d5cc6dd89fea49f46ac9b4d70
parent6fbc7275c7a9ba97877050335f290341a1fd8dbf (diff)
KVM: x86: degrade WARN to pr_warn_ratelimited
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>
-rw-r--r--arch/x86/kvm/x86.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9857992d4e58..fafd81d2c9ea 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1554,7 +1554,7 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
1554 vcpu->arch.tsc_always_catchup = 1; 1554 vcpu->arch.tsc_always_catchup = 1;
1555 return 0; 1555 return 0;
1556 } else { 1556 } else {
1557 WARN(1, "user requested TSC rate below hardware speed\n"); 1557 pr_warn_ratelimited("user requested TSC rate below hardware speed\n");
1558 return -1; 1558 return -1;
1559 } 1559 }
1560 } 1560 }
@@ -1564,8 +1564,8 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
1564 user_tsc_khz, tsc_khz); 1564 user_tsc_khz, tsc_khz);
1565 1565
1566 if (ratio == 0 || ratio >= kvm_max_tsc_scaling_ratio) { 1566 if (ratio == 0 || ratio >= kvm_max_tsc_scaling_ratio) {
1567 WARN_ONCE(1, "Invalid TSC scaling ratio - virtual-tsc-khz=%u\n", 1567 pr_warn_ratelimited("Invalid TSC scaling ratio - virtual-tsc-khz=%u\n",
1568 user_tsc_khz); 1568 user_tsc_khz);
1569 return -1; 1569 return -1;
1570 } 1570 }
1571 1571