diff options
Diffstat (limited to 'arch/x86/kvm/mmu_audit.c')
-rw-r--r-- | arch/x86/kvm/mmu_audit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu_audit.c b/arch/x86/kvm/mmu_audit.c index 2460a265be23..746ec259d024 100644 --- a/arch/x86/kvm/mmu_audit.c +++ b/arch/x86/kvm/mmu_audit.c | |||
@@ -121,16 +121,16 @@ static void audit_mappings(struct kvm_vcpu *vcpu, u64 *sptep, int level) | |||
121 | 121 | ||
122 | static void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep) | 122 | static void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep) |
123 | { | 123 | { |
124 | static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10); | ||
124 | unsigned long *rmapp; | 125 | unsigned long *rmapp; |
125 | struct kvm_mmu_page *rev_sp; | 126 | struct kvm_mmu_page *rev_sp; |
126 | gfn_t gfn; | 127 | gfn_t gfn; |
127 | 128 | ||
128 | |||
129 | rev_sp = page_header(__pa(sptep)); | 129 | rev_sp = page_header(__pa(sptep)); |
130 | gfn = kvm_mmu_page_get_gfn(rev_sp, sptep - rev_sp->spt); | 130 | gfn = kvm_mmu_page_get_gfn(rev_sp, sptep - rev_sp->spt); |
131 | 131 | ||
132 | if (!gfn_to_memslot(kvm, gfn)) { | 132 | if (!gfn_to_memslot(kvm, gfn)) { |
133 | if (!printk_ratelimit()) | 133 | if (!__ratelimit(&ratelimit_state)) |
134 | return; | 134 | return; |
135 | audit_printk(kvm, "no memslot for gfn %llx\n", gfn); | 135 | audit_printk(kvm, "no memslot for gfn %llx\n", gfn); |
136 | audit_printk(kvm, "index %ld of sp (gfn=%llx)\n", | 136 | audit_printk(kvm, "index %ld of sp (gfn=%llx)\n", |
@@ -141,7 +141,7 @@ static void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep) | |||
141 | 141 | ||
142 | rmapp = gfn_to_rmap(kvm, gfn, rev_sp->role.level); | 142 | rmapp = gfn_to_rmap(kvm, gfn, rev_sp->role.level); |
143 | if (!*rmapp) { | 143 | if (!*rmapp) { |
144 | if (!printk_ratelimit()) | 144 | if (!__ratelimit(&ratelimit_state)) |
145 | return; | 145 | return; |
146 | audit_printk(kvm, "no rmap for writable spte %llx\n", | 146 | audit_printk(kvm, "no rmap for writable spte %llx\n", |
147 | *sptep); | 147 | *sptep); |