diff options
author | Avi Kivity <avi@qumranet.com> | 2008-06-13 22:45:42 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-06-13 22:45:42 +0300 |
commit | d660add61a69df36372c73e68d2532190ca6430c (patch) | |
tree | 90d7132aeb96f4a02b4b82b44a161f8e63990382 | |
parent | c1b11ebee6bda13878562b894ee811141dd06198 (diff) |
KVM: Use printk_rlimit() instead of reporting emulation failures just oncekvm-70rc2
Emulation failure reports are useful, so allow more than one per the lifetime
of the module.
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 369892265a08..26b051b78eef 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2027,12 +2027,11 @@ int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long value) void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context) { - static int reported; u8 opcodes[4]; unsigned long rip = vcpu->arch.rip; unsigned long rip_linear; - if (reported) + if (!printk_ratelimit()) return; rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS); @@ -2041,7 +2040,6 @@ void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context) printk(KERN_ERR "emulation failed (%s) rip %lx %02x %02x %02x %02x\n", context, rip, opcodes[0], opcodes[1], opcodes[2], opcodes[3]); - reported = 1; } EXPORT_SYMBOL_GPL(kvm_report_emulation_failure); |