1
2 #ifndef _ASM_X86_KVM_PAGE_TRACK_H
3 #define _ASM_X86_KVM_PAGE_TRACK_H
4
5 enum kvm_page_track_mode {
6 KVM_PAGE_TRACK_WRITE,
7 KVM_PAGE_TRACK_MAX,
8 };
9
10
11
12
13
14
15
16
17 struct kvm_page_track_notifier_head {
18 struct srcu_struct track_srcu;
19 struct hlist_head track_notifier_list;
20 };
21
22 struct kvm_page_track_notifier_node {
23 struct hlist_node node;
24
25
26
27
28
29
30
31
32
33
34
35 void (*track_write)(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
36 int bytes, struct kvm_page_track_notifier_node *node);
37
38
39
40
41
42
43
44
45 void (*track_flush_slot)(struct kvm *kvm, struct kvm_memory_slot *slot,
46 struct kvm_page_track_notifier_node *node);
47 };
48
49 void kvm_page_track_init(struct kvm *kvm);
50 void kvm_page_track_cleanup(struct kvm *kvm);
51
52 void kvm_page_track_free_memslot(struct kvm_memory_slot *free,
53 struct kvm_memory_slot *dont);
54 int kvm_page_track_create_memslot(struct kvm_memory_slot *slot,
55 unsigned long npages);
56
57 void kvm_slot_page_track_add_page(struct kvm *kvm,
58 struct kvm_memory_slot *slot, gfn_t gfn,
59 enum kvm_page_track_mode mode);
60 void kvm_slot_page_track_remove_page(struct kvm *kvm,
61 struct kvm_memory_slot *slot, gfn_t gfn,
62 enum kvm_page_track_mode mode);
63 bool kvm_page_track_is_active(struct kvm_vcpu *vcpu, gfn_t gfn,
64 enum kvm_page_track_mode mode);
65
66 void
67 kvm_page_track_register_notifier(struct kvm *kvm,
68 struct kvm_page_track_notifier_node *n);
69 void
70 kvm_page_track_unregister_notifier(struct kvm *kvm,
71 struct kvm_page_track_notifier_node *n);
72 void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
73 int bytes);
74 void kvm_page_track_flush_slot(struct kvm *kvm, struct kvm_memory_slot *slot);
75 #endif