From e2e04f4f66db34d8692fd66cf73b6dcc8f636e40 Mon Sep 17 00:00:00 2001 From: Xiao Guangrong Date: Mon, 30 Aug 2010 18:26:33 +0800 Subject: [PATCH] --- yaml --- r: 215819 b: refs/heads/master c: 30644b902c5eef5328d37a2e15f1921aaca2588b h: refs/heads/master i: 215817: d5e371eb2107c8a0877af4b80f8043c635d02201 215815: 8cde2fdfdb65219740ccbe1d96b15c7b69f0dc6d v: v3 --- [refs] | 2 +- trunk/arch/x86/kvm/mmu_audit.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f9c3c4425491..6ccc28ce5f61 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eb2591865a234c6fb1162085d9b277236fa890b6 +refs/heads/master: 30644b902c5eef5328d37a2e15f1921aaca2588b diff --git a/trunk/arch/x86/kvm/mmu_audit.c b/trunk/arch/x86/kvm/mmu_audit.c index 3bde186409bf..bd2b1be7066e 100644 --- a/trunk/arch/x86/kvm/mmu_audit.c +++ b/trunk/arch/x86/kvm/mmu_audit.c @@ -17,6 +17,8 @@ * */ +#include + static const char *audit_msg; typedef void (*inspect_spte_fn) (struct kvm_vcpu *vcpu, u64 *sptep, int level); @@ -228,6 +230,11 @@ static void audit_vcpu_spte(struct kvm_vcpu *vcpu) static void kvm_mmu_audit(void *ignore, struct kvm_vcpu *vcpu, int audit_point) { + static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10); + + if (!__ratelimit(&ratelimit_state)) + return; + audit_msg = audit_point_name[audit_point]; audit_all_active_sps(vcpu->kvm); audit_vcpu_spte(vcpu);