1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a copy 3*4882a593Smuzhiyun * of this software and associated documentation files (the "Software"), to 4*4882a593Smuzhiyun * deal in the Software without restriction, including without limitation the 5*4882a593Smuzhiyun * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 6*4882a593Smuzhiyun * sell copies of the Software, and to permit persons to whom the Software is 7*4882a593Smuzhiyun * furnished to do so, subject to the following conditions: 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 10*4882a593Smuzhiyun * all copies or substantial portions of the Software. 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15*4882a593Smuzhiyun * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16*4882a593Smuzhiyun * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17*4882a593Smuzhiyun * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 18*4882a593Smuzhiyun * DEALINGS IN THE SOFTWARE. 19*4882a593Smuzhiyun */ 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__ 22*4882a593Smuzhiyun #define __XEN_PUBLIC_HVM_HVM_OP_H__ 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun #include <xen/interface/xen.h> 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun /* Get/set subcommands: the second argument of the hypercall is a 27*4882a593Smuzhiyun * pointer to a xen_hvm_param struct. */ 28*4882a593Smuzhiyun #define HVMOP_set_param 0 29*4882a593Smuzhiyun #define HVMOP_get_param 1 30*4882a593Smuzhiyun struct xen_hvm_param { 31*4882a593Smuzhiyun domid_t domid; /* IN */ 32*4882a593Smuzhiyun uint32_t index; /* IN */ 33*4882a593Smuzhiyun uint64_t value; /* IN/OUT */ 34*4882a593Smuzhiyun }; 35*4882a593Smuzhiyun DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_param); 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun /* Hint from PV drivers for pagetable destruction. */ 38*4882a593Smuzhiyun #define HVMOP_pagetable_dying 9 39*4882a593Smuzhiyun struct xen_hvm_pagetable_dying { 40*4882a593Smuzhiyun /* Domain with a pagetable about to be destroyed. */ 41*4882a593Smuzhiyun domid_t domid; 42*4882a593Smuzhiyun /* guest physical address of the toplevel pagetable dying */ 43*4882a593Smuzhiyun aligned_u64 gpa; 44*4882a593Smuzhiyun }; 45*4882a593Smuzhiyun typedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t; 46*4882a593Smuzhiyun DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_pagetable_dying_t); 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun enum hvmmem_type_t { 49*4882a593Smuzhiyun HVMMEM_ram_rw, /* Normal read/write guest RAM */ 50*4882a593Smuzhiyun HVMMEM_ram_ro, /* Read-only; writes are discarded */ 51*4882a593Smuzhiyun HVMMEM_mmio_dm, /* Reads and write go to the device model */ 52*4882a593Smuzhiyun }; 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun #define HVMOP_get_mem_type 15 55*4882a593Smuzhiyun /* Return hvmmem_type_t for the specified pfn. */ 56*4882a593Smuzhiyun struct xen_hvm_get_mem_type { 57*4882a593Smuzhiyun /* Domain to be queried. */ 58*4882a593Smuzhiyun domid_t domid; 59*4882a593Smuzhiyun /* OUT variable. */ 60*4882a593Smuzhiyun uint16_t mem_type; 61*4882a593Smuzhiyun uint16_t pad[2]; /* align next field on 8-byte boundary */ 62*4882a593Smuzhiyun /* IN variable. */ 63*4882a593Smuzhiyun uint64_t pfn; 64*4882a593Smuzhiyun }; 65*4882a593Smuzhiyun DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_get_mem_type); 66*4882a593Smuzhiyun 67*4882a593Smuzhiyun #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */ 68