18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy 38c2ecf20Sopenharmony_ci * of this software and associated documentation files (the "Software"), to 48c2ecf20Sopenharmony_ci * deal in the Software without restriction, including without limitation the 58c2ecf20Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 68c2ecf20Sopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is 78c2ecf20Sopenharmony_ci * furnished to do so, subject to the following conditions: 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in 108c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software. 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 138c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 148c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 158c2ecf20Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 168c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 178c2ecf20Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 188c2ecf20Sopenharmony_ci * DEALINGS IN THE SOFTWARE. 198c2ecf20Sopenharmony_ci */ 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#ifndef __XEN_PUBLIC_HVM_HVM_OP_H__ 228c2ecf20Sopenharmony_ci#define __XEN_PUBLIC_HVM_HVM_OP_H__ 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#include <xen/interface/xen.h> 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/* Get/set subcommands: the second argument of the hypercall is a 278c2ecf20Sopenharmony_ci * pointer to a xen_hvm_param struct. */ 288c2ecf20Sopenharmony_ci#define HVMOP_set_param 0 298c2ecf20Sopenharmony_ci#define HVMOP_get_param 1 308c2ecf20Sopenharmony_cistruct xen_hvm_param { 318c2ecf20Sopenharmony_ci domid_t domid; /* IN */ 328c2ecf20Sopenharmony_ci uint32_t index; /* IN */ 338c2ecf20Sopenharmony_ci uint64_t value; /* IN/OUT */ 348c2ecf20Sopenharmony_ci}; 358c2ecf20Sopenharmony_ciDEFINE_GUEST_HANDLE_STRUCT(xen_hvm_param); 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* Hint from PV drivers for pagetable destruction. */ 388c2ecf20Sopenharmony_ci#define HVMOP_pagetable_dying 9 398c2ecf20Sopenharmony_cistruct xen_hvm_pagetable_dying { 408c2ecf20Sopenharmony_ci /* Domain with a pagetable about to be destroyed. */ 418c2ecf20Sopenharmony_ci domid_t domid; 428c2ecf20Sopenharmony_ci /* guest physical address of the toplevel pagetable dying */ 438c2ecf20Sopenharmony_ci aligned_u64 gpa; 448c2ecf20Sopenharmony_ci}; 458c2ecf20Sopenharmony_citypedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t; 468c2ecf20Sopenharmony_ciDEFINE_GUEST_HANDLE_STRUCT(xen_hvm_pagetable_dying_t); 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_cienum hvmmem_type_t { 498c2ecf20Sopenharmony_ci HVMMEM_ram_rw, /* Normal read/write guest RAM */ 508c2ecf20Sopenharmony_ci HVMMEM_ram_ro, /* Read-only; writes are discarded */ 518c2ecf20Sopenharmony_ci HVMMEM_mmio_dm, /* Reads and write go to the device model */ 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define HVMOP_get_mem_type 15 558c2ecf20Sopenharmony_ci/* Return hvmmem_type_t for the specified pfn. */ 568c2ecf20Sopenharmony_cistruct xen_hvm_get_mem_type { 578c2ecf20Sopenharmony_ci /* Domain to be queried. */ 588c2ecf20Sopenharmony_ci domid_t domid; 598c2ecf20Sopenharmony_ci /* OUT variable. */ 608c2ecf20Sopenharmony_ci uint16_t mem_type; 618c2ecf20Sopenharmony_ci uint16_t pad[2]; /* align next field on 8-byte boundary */ 628c2ecf20Sopenharmony_ci /* IN variable. */ 638c2ecf20Sopenharmony_ci uint64_t pfn; 648c2ecf20Sopenharmony_ci}; 658c2ecf20Sopenharmony_ciDEFINE_GUEST_HANDLE_STRUCT(xen_hvm_get_mem_type); 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */ 68