vki-xen-hvm.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. This file is part of Valgrind, a dynamic binary instrumentation
  3. framework.
  4. Copyright (C) 2012-2017 Citrix
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307, USA.
  17. The GNU General Public License is contained in the file COPYING.
  18. */
  19. /* Contributed by Andrew Cooper <andrew.cooper3@citrix.com>
  20. and Ian Campbell <ian.campbell@citrix.com> */
  21. #ifndef __VKI_XEN_HVM_H
  22. #define __VKI_XEN_HVM_H
  23. /* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */
  24. #define VKI_XEN_HVMOP_set_param 0
  25. #define VKI_XEN_HVMOP_get_param 1
  26. struct vki_xen_hvm_param {
  27. vki_xen_domid_t domid; /* IN */
  28. vki_uint32_t index; /* IN */
  29. vki_uint64_t value; /* IN/OUT */
  30. };
  31. #define VKI_XEN_HVMOP_set_pci_intx_level 2
  32. struct vki_xen_hvm_set_pci_intx_level {
  33. vki_xen_domid_t domid;
  34. vki_uint8_t domain, bus, device, intx;
  35. vki_uint8_t level;
  36. };
  37. typedef struct vki_xen_hvm_set_pci_intx_level vki_xen_hvm_set_pci_intx_level_t;
  38. #define VKI_XEN_HVMOP_set_isa_irq_level 3
  39. struct vki_xen_hvm_set_isa_irq_level {
  40. vki_xen_domid_t domid;
  41. vki_uint8_t isa_irq;
  42. vki_uint8_t level;
  43. };
  44. typedef struct vki_xen_hvm_set_isa_irq_level vki_xen_hvm_set_isa_irq_level_t;
  45. #define VKI_XEN_HVMOP_set_pci_link_route 4
  46. struct vki_xen_hvm_set_pci_link_route {
  47. vki_xen_domid_t domid;
  48. vki_uint8_t link;
  49. vki_uint8_t isa_irq;
  50. };
  51. typedef struct vki_xen_hvm_set_pci_link_route vki_xen_hvm_set_pci_link_route_t;
  52. #define VKI_XEN_HVMOP_track_dirty_vram 6
  53. struct vki_xen_hvm_track_dirty_vram {
  54. vki_xen_domid_t domid; /* IN */
  55. vki_xen_uint64_aligned_t first_pfn; /* IN */
  56. vki_xen_uint64_aligned_t nr; /* IN */
  57. VKI_XEN_GUEST_HANDLE_64(vki_uint8) dirty_bitmap; /* OUT */
  58. };
  59. typedef struct vki_xen_hvm_track_dirty_vram vki_xen_hvm_track_dirty_vram_t;
  60. #define VKI_XEN_HVMOP_set_mem_type 8
  61. struct vki_xen_hvm_set_mem_type {
  62. vki_xen_domid_t domid;
  63. vki_uint16_t hvmmem_type;
  64. vki_uint32_t nr;
  65. vki_uint64_t first_pfn;
  66. };
  67. typedef struct vki_xen_hvm_set_mem_type vki_xen_hvm_set_mem_type_t;
  68. #define VKI_XEN_HVMOP_set_mem_access 12
  69. struct vki_xen_hvm_set_mem_access {
  70. vki_xen_domid_t domid;
  71. vki_uint16_t hvmmem_access;
  72. vki_uint32_t nr;
  73. vki_uint64_t first_pfn;
  74. };
  75. typedef struct vki_xen_hvm_set_mem_access vki_xen_hvm_set_mem_access_t;
  76. #define VKI_XEN_HVMOP_get_mem_access 13
  77. struct vki_xen_hvm_get_mem_access {
  78. vki_xen_domid_t domid;
  79. vki_uint16_t hvmmem_access; /* OUT */
  80. vki_uint64_t pfn;
  81. };
  82. typedef struct vki_xen_hvm_get_mem_access vki_xen_hvm_get_mem_access_t;
  83. #define VKI_XEN_HVMOP_inject_trap 14
  84. struct vki_xen_hvm_inject_trap {
  85. vki_xen_domid_t domid;
  86. vki_uint32_t vcpuid;
  87. vki_uint32_t vector;
  88. vki_uint32_t type;
  89. vki_uint32_t error_code;
  90. vki_uint32_t insn_len;
  91. vki_uint64_t cr2;
  92. };
  93. typedef struct vki_xen_hvm_inject_trap vki_xen_hvm_inject_trap_t;
  94. #endif // __VKI_XEN_HVM_H
  95. /*--------------------------------------------------------------------*/
  96. /*--- end ---*/
  97. /*--------------------------------------------------------------------*/