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