kvm_types.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __KVM_TYPES_H__
  3. #define __KVM_TYPES_H__
  4. struct kvm;
  5. struct kvm_async_pf;
  6. struct kvm_device_ops;
  7. struct kvm_interrupt;
  8. struct kvm_irq_routing_table;
  9. struct kvm_memory_slot;
  10. struct kvm_one_reg;
  11. struct kvm_run;
  12. struct kvm_userspace_memory_region;
  13. struct kvm_vcpu;
  14. struct kvm_vcpu_init;
  15. struct kvm_memslots;
  16. enum kvm_mr_change;
  17. #include <linux/types.h>
  18. /*
  19. * Address types:
  20. *
  21. * gva - guest virtual address
  22. * gpa - guest physical address
  23. * gfn - guest frame number
  24. * hva - host virtual address
  25. * hpa - host physical address
  26. * hfn - host frame number
  27. */
  28. typedef unsigned long gva_t;
  29. typedef u64 gpa_t;
  30. typedef u64 gfn_t;
  31. typedef unsigned long hva_t;
  32. typedef u64 hpa_t;
  33. typedef u64 hfn_t;
  34. typedef hfn_t kvm_pfn_t;
  35. struct gfn_to_hva_cache {
  36. u64 generation;
  37. gpa_t gpa;
  38. unsigned long hva;
  39. unsigned long len;
  40. struct kvm_memory_slot *memslot;
  41. };
  42. struct gfn_to_pfn_cache {
  43. u64 generation;
  44. gfn_t gfn;
  45. kvm_pfn_t pfn;
  46. bool dirty;
  47. };
  48. #endif /* __KVM_TYPES_H__ */