~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/kvm/mmu/page_track.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __KVM_X86_PAGE_TRACK_H
  3 #define __KVM_X86_PAGE_TRACK_H
  4 
  5 #include <linux/kvm_host.h>
  6 
  7 #include <asm/kvm_page_track.h>
  8 
  9 
 10 bool kvm_page_track_write_tracking_enabled(struct kvm *kvm);
 11 int kvm_page_track_write_tracking_alloc(struct kvm_memory_slot *slot);
 12 
 13 void kvm_page_track_free_memslot(struct kvm_memory_slot *slot);
 14 int kvm_page_track_create_memslot(struct kvm *kvm,
 15                                   struct kvm_memory_slot *slot,
 16                                   unsigned long npages);
 17 
 18 void __kvm_write_track_add_gfn(struct kvm *kvm, struct kvm_memory_slot *slot,
 19                                gfn_t gfn);
 20 void __kvm_write_track_remove_gfn(struct kvm *kvm,
 21                                   struct kvm_memory_slot *slot, gfn_t gfn);
 22 
 23 bool kvm_gfn_is_write_tracked(struct kvm *kvm,
 24                               const struct kvm_memory_slot *slot, gfn_t gfn);
 25 
 26 #ifdef CONFIG_KVM_EXTERNAL_WRITE_TRACKING
 27 int kvm_page_track_init(struct kvm *kvm);
 28 void kvm_page_track_cleanup(struct kvm *kvm);
 29 
 30 void __kvm_page_track_write(struct kvm *kvm, gpa_t gpa, const u8 *new, int bytes);
 31 void kvm_page_track_delete_slot(struct kvm *kvm, struct kvm_memory_slot *slot);
 32 
 33 static inline bool kvm_page_track_has_external_user(struct kvm *kvm)
 34 {
 35         return !hlist_empty(&kvm->arch.track_notifier_head.track_notifier_list);
 36 }
 37 #else
 38 static inline int kvm_page_track_init(struct kvm *kvm) { return 0; }
 39 static inline void kvm_page_track_cleanup(struct kvm *kvm) { }
 40 
 41 static inline void __kvm_page_track_write(struct kvm *kvm, gpa_t gpa,
 42                                           const u8 *new, int bytes) { }
 43 static inline void kvm_page_track_delete_slot(struct kvm *kvm,
 44                                               struct kvm_memory_slot *slot) { }
 45 
 46 static inline bool kvm_page_track_has_external_user(struct kvm *kvm) { return false; }
 47 
 48 #endif /* CONFIG_KVM_EXTERNAL_WRITE_TRACKING */
 49 
 50 static inline void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa,
 51                                         const u8 *new, int bytes)
 52 {
 53         __kvm_page_track_write(vcpu->kvm, gpa, new, bytes);
 54 
 55         kvm_mmu_track_write(vcpu, gpa, new, bytes);
 56 }
 57 
 58 #endif /* __KVM_X86_PAGE_TRACK_H */
 59 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php