Lines Matching refs:kvm
31 #define audit_printk(kvm, fmt, args...) \ argument
33 fmt, audit_point_name[kvm->arch.audit_point], ##args)
86 typedef void (*sp_handler) (struct kvm *kvm, struct kvm_mmu_page *sp);
88 static void walk_all_active_sps(struct kvm *kvm, sp_handler fn) in walk_all_active_sps() argument
92 list_for_each_entry(sp, &kvm->arch.active_mmu_pages, link) in walk_all_active_sps()
93 fn(kvm, sp); in walk_all_active_sps()
107 audit_printk(vcpu->kvm, "unsync sp: %p " in audit_mappings()
117 pfn = gfn_to_pfn_atomic(vcpu->kvm, gfn); in audit_mappings()
124 audit_printk(vcpu->kvm, "levels %d pfn %llx hpa %llx " in audit_mappings()
129 static void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep) in inspect_spte_has_rmap() argument
139 if (!gfn_to_memslot(kvm, gfn)) { in inspect_spte_has_rmap()
142 audit_printk(kvm, "no memslot for gfn %llx\n", gfn); in inspect_spte_has_rmap()
143 audit_printk(kvm, "index %ld of sp (gfn=%llx)\n", in inspect_spte_has_rmap()
149 rmapp = gfn_to_rmap(kvm, gfn, rev_sp->role.level); in inspect_spte_has_rmap()
153 audit_printk(kvm, "no rmap for writable spte %llx\n", in inspect_spte_has_rmap()
162 inspect_spte_has_rmap(vcpu->kvm, sptep); in audit_sptes_have_rmaps()
169 if (vcpu->kvm->arch.audit_point == AUDIT_POST_SYNC && sp->unsync) in audit_spte_after_sync()
170 audit_printk(vcpu->kvm, "meet unsync sp(%p) after sync " in audit_spte_after_sync()
174 static void check_mappings_rmap(struct kvm *kvm, struct kvm_mmu_page *sp) in check_mappings_rmap() argument
185 inspect_spte_has_rmap(kvm, sp->spt + i); in check_mappings_rmap()
189 static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) in audit_write_protection() argument
198 rmapp = gfn_to_rmap(kvm, sp->gfn, PT_PAGE_TABLE_LEVEL); in audit_write_protection()
203 audit_printk(kvm, "shadow page has writable " in audit_write_protection()
209 static void audit_sp(struct kvm *kvm, struct kvm_mmu_page *sp) in audit_sp() argument
211 check_mappings_rmap(kvm, sp); in audit_sp()
212 audit_write_protection(kvm, sp); in audit_sp()
215 static void audit_all_active_sps(struct kvm *kvm) in audit_all_active_sps() argument
217 walk_all_active_sps(kvm, audit_sp); in audit_all_active_sps()
242 vcpu->kvm->arch.audit_point = point; in __kvm_mmu_audit()
243 audit_all_active_sps(vcpu->kvm); in __kvm_mmu_audit()