Skip to content

Commit d271f22

Browse files
bonzinigregkh
authored andcommitted
KVM: x86: degrade WARN to pr_warn_ratelimited
commit 3f16a5c upstream. This warning can be triggered easily by userspace, so it should certainly not cause a panic if panic_on_warn is set. Reported-by: [email protected] Suggested-by: Alexander Potapenko <[email protected]> Acked-by: Alexander Potapenko <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 05cd693 commit d271f22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/kvm/x86.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
13651365
vcpu->arch.tsc_always_catchup = 1;
13661366
return 0;
13671367
} else {
1368-
WARN(1, "user requested TSC rate below hardware speed\n");
1368+
pr_warn_ratelimited("user requested TSC rate below hardware speed\n");
13691369
return -1;
13701370
}
13711371
}
@@ -1375,8 +1375,8 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
13751375
user_tsc_khz, tsc_khz);
13761376

13771377
if (ratio == 0 || ratio >= kvm_max_tsc_scaling_ratio) {
1378-
WARN_ONCE(1, "Invalid TSC scaling ratio - virtual-tsc-khz=%u\n",
1379-
user_tsc_khz);
1378+
pr_warn_ratelimited("Invalid TSC scaling ratio - virtual-tsc-khz=%u\n",
1379+
user_tsc_khz);
13801380
return -1;
13811381
}
13821382

0 commit comments

Comments
 (0)