diff options
author | Xiaoguang Chen <xiaoguang.chen@intel.com> | 2016-10-09 15:41:44 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-11-04 12:13:19 +0100 |
commit | ae7cd87372a473509aa32ba9ad8bd1401f65d375 (patch) | |
tree | 1b938cb863571d8a185a18e29a077cc3a3f0f651 /arch/x86/include/asm/kvm_page_track.h | |
parent | d9092f52d7e61dd1557f2db2400ddb430e85937e (diff) | |
download | linux-stable-ae7cd87372a473509aa32ba9ad8bd1401f65d375.tar.gz linux-stable-ae7cd87372a473509aa32ba9ad8bd1401f65d375.tar.bz2 linux-stable-ae7cd87372a473509aa32ba9ad8bd1401f65d375.zip |
KVM: x86: add track_flush_slot page track notifier
When a memory slot is being moved or removed users of page track
can be notified. So users can drop write-protection for the pages
in that memory slot.
This notifier type is needed by KVMGT to sync up its shadow page
table when memory slot is being moved or removed.
Register the notifier type track_flush_slot to receive memslot move
and remove event.
Reviewed-by: Xiao Guangrong <guangrong.xiao@intel.com>
Signed-off-by: Chen Xiaoguang <xiaoguang.chen@intel.com>
[Squashed commits to avoid bisection breakage and reworded the subject.]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_page_track.h')
-rw-r--r-- | arch/x86/include/asm/kvm_page_track.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_page_track.h b/arch/x86/include/asm/kvm_page_track.h index c2b8d24a235c..5f66597c71c0 100644 --- a/arch/x86/include/asm/kvm_page_track.h +++ b/arch/x86/include/asm/kvm_page_track.h @@ -32,6 +32,14 @@ struct kvm_page_track_notifier_node { */ void (*track_write)(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new, int bytes); + /* + * It is called when memory slot is being moved or removed + * users can drop write-protection for the pages in that memory slot + * + * @kvm: the kvm where memory slot being moved or removed + * @slot: the memory slot being moved or removed + */ + void (*track_flush_slot)(struct kvm *kvm, struct kvm_memory_slot *slot); }; void kvm_page_track_init(struct kvm *kvm); @@ -58,4 +66,5 @@ kvm_page_track_unregister_notifier(struct kvm *kvm, struct kvm_page_track_notifier_node *n); void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new, int bytes); +void kvm_page_track_flush_slot(struct kvm *kvm, struct kvm_memory_slot *slot); #endif |