hvm_op.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: MIT */
  2. #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
  3. #define __XEN_PUBLIC_HVM_HVM_OP_H__
  4. #include <xen/interface/xen.h>
  5. /* Get/set subcommands: the second argument of the hypercall is a
  6. * pointer to a xen_hvm_param struct. */
  7. #define HVMOP_set_param 0
  8. #define HVMOP_get_param 1
  9. struct xen_hvm_param {
  10. domid_t domid; /* IN */
  11. uint32_t index; /* IN */
  12. uint64_t value; /* IN/OUT */
  13. };
  14. DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_param);
  15. /* Hint from PV drivers for pagetable destruction. */
  16. #define HVMOP_pagetable_dying 9
  17. struct xen_hvm_pagetable_dying {
  18. /* Domain with a pagetable about to be destroyed. */
  19. domid_t domid;
  20. /* guest physical address of the toplevel pagetable dying */
  21. aligned_u64 gpa;
  22. };
  23. typedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t;
  24. DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_pagetable_dying_t);
  25. enum hvmmem_type_t {
  26. HVMMEM_ram_rw, /* Normal read/write guest RAM */
  27. HVMMEM_ram_ro, /* Read-only; writes are discarded */
  28. HVMMEM_mmio_dm, /* Reads and write go to the device model */
  29. };
  30. #define HVMOP_get_mem_type 15
  31. /* Return hvmmem_type_t for the specified pfn. */
  32. struct xen_hvm_get_mem_type {
  33. /* Domain to be queried. */
  34. domid_t domid;
  35. /* OUT variable. */
  36. uint16_t mem_type;
  37. uint16_t pad[2]; /* align next field on 8-byte boundary */
  38. /* IN variable. */
  39. uint64_t pfn;
  40. };
  41. DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_get_mem_type);
  42. #if defined(__i386__) || defined(__x86_64__)
  43. /*
  44. * HVMOP_set_evtchn_upcall_vector: Set a <vector> that should be used for event
  45. * channel upcalls on the specified <vcpu>. If set,
  46. * this vector will be used in preference to the
  47. * domain global callback via (see
  48. * HVM_PARAM_CALLBACK_IRQ).
  49. */
  50. #define HVMOP_set_evtchn_upcall_vector 23
  51. struct xen_hvm_evtchn_upcall_vector {
  52. uint32_t vcpu;
  53. uint8_t vector;
  54. };
  55. typedef struct xen_hvm_evtchn_upcall_vector xen_hvm_evtchn_upcall_vector_t;
  56. DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_evtchn_upcall_vector_t);
  57. #endif /* defined(__i386__) || defined(__x86_64__) */
  58. #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */