kvm_types.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the License.
  5. *
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. * GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License
  12. * along with this program; if not, write to the Free Software
  13. * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  14. *
  15. */
  16. #ifndef __KVM_TYPES_H__
  17. #define __KVM_TYPES_H__
  18. struct kvm;
  19. struct kvm_async_pf;
  20. struct kvm_device_ops;
  21. struct kvm_interrupt;
  22. struct kvm_irq_routing_table;
  23. struct kvm_memory_slot;
  24. struct kvm_one_reg;
  25. struct kvm_run;
  26. struct kvm_userspace_memory_region;
  27. struct kvm_vcpu;
  28. struct kvm_vcpu_init;
  29. enum kvm_mr_change;
  30. #include <asm/types.h>
  31. /*
  32. * Address types:
  33. *
  34. * gva - guest virtual address
  35. * gpa - guest physical address
  36. * gfn - guest frame number
  37. * hva - host virtual address
  38. * hpa - host physical address
  39. * hfn - host frame number
  40. */
  41. typedef unsigned long gva_t;
  42. typedef u64 gpa_t;
  43. typedef u64 gfn_t;
  44. typedef unsigned long hva_t;
  45. typedef u64 hpa_t;
  46. typedef u64 hfn_t;
  47. typedef hfn_t pfn_t;
  48. union kvm_ioapic_redirect_entry {
  49. u64 bits;
  50. struct {
  51. u8 vector;
  52. u8 delivery_mode:3;
  53. u8 dest_mode:1;
  54. u8 delivery_status:1;
  55. u8 polarity:1;
  56. u8 remote_irr:1;
  57. u8 trig_mode:1;
  58. u8 mask:1;
  59. u8 reserve:7;
  60. u8 reserved[4];
  61. u8 dest_id;
  62. } fields;
  63. };
  64. struct kvm_lapic_irq {
  65. u32 vector;
  66. u32 delivery_mode;
  67. u32 dest_mode;
  68. u32 level;
  69. u32 trig_mode;
  70. u32 shorthand;
  71. u32 dest_id;
  72. };
  73. struct gfn_to_hva_cache {
  74. u64 generation;
  75. gpa_t gpa;
  76. unsigned long hva;
  77. unsigned long len;
  78. struct kvm_memory_slot *memslot;
  79. };
  80. #endif /* __KVM_TYPES_H__ */