iPXE
hvm_op.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright (c) 2007, Keir Fraser
4 */
5
6#ifndef __XEN_PUBLIC_HVM_HVM_OP_H__
7#define __XEN_PUBLIC_HVM_HVM_OP_H__
8
10FILE_SECBOOT ( PERMITTED );
11
12#include "../xen.h"
13#include "../trace.h"
14#include "../event_channel.h"
15
16/* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */
17#define HVMOP_set_param 0
18#define HVMOP_get_param 1
20 domid_t domid; /* IN */
22 uint32_t index; /* IN */
23 uint64_t value; /* IN/OUT */
24};
27
35
38 uint8_t suppress_ve; /* Boolean type. */
40 int32_t first_error; /* Should be set to 0. */
41 uint64_t first_gfn; /* Value may be updated. */
43 uint64_t first_error_gfn; /* Gfn of the first error. */
44};
45
46#if __XEN_INTERFACE_VERSION__ < 0x00040900
47
48/* Set the logical level of one of a domain's PCI INTx wires. */
49#define HVMOP_set_pci_intx_level 2
51 /* Domain to be updated. */
53 /* PCI INTx identification in PCI topology (domain:bus:device:intx). */
55 /* Assertion level (0 = unasserted, 1 = asserted). */
57};
60
61/* Set the logical level of one of a domain's ISA IRQ wires. */
62#define HVMOP_set_isa_irq_level 3
64 /* Domain to be updated. */
66 /* ISA device identification, by ISA IRQ (0-15). */
68 /* Assertion level (0 = unasserted, 1 = asserted). */
70};
73
74#define HVMOP_set_pci_link_route 4
76 /* Domain to be updated. */
78 /* PCI link identifier (0-3). */
80 /* ISA IRQ (1-15), or 0 (disable link). */
82};
85
86#endif /* __XEN_INTERFACE_VERSION__ < 0x00040900 */
87
88/* Flushes all VCPU TLBs: @arg must be NULL. */
89#define HVMOP_flush_tlbs 5
90
91/*
92 * hvmmem_type_t should not be defined when generating the corresponding
93 * compat header. This will ensure that the improperly named HVMMEM_(*)
94 * values are defined only once.
95 */
96#ifndef XEN_GENERATING_COMPAT_HEADERS
97
98typedef enum {
99 HVMMEM_ram_rw, /* Normal read/write guest RAM */
100 HVMMEM_ram_ro, /* Read-only; writes are discarded */
101 HVMMEM_mmio_dm, /* Reads and write go to the device model */
102#if __XEN_INTERFACE_VERSION__ < 0x00040700
103 HVMMEM_mmio_write_dm, /* Read-only; writes go to the device model */
104#else
105 HVMMEM_unused, /* Placeholder; setting memory to this type
106 will fail for code after 4.7.0 */
107#endif
108 HVMMEM_ioreq_server /* Memory type claimed by an ioreq server; type
109 changes to this value are only allowed after
110 an ioreq server has claimed its ownership.
111 Only pages with HVMMEM_ram_rw are allowed to
112 change to this type; conversely, pages with
113 this type are only allowed to be changed back
114 to HVMMEM_ram_rw. */
116
117#endif /* XEN_GENERATING_COMPAT_HEADERS */
118
119/* Hint from PV drivers for pagetable destruction. */
120#define HVMOP_pagetable_dying 9
122 /* Domain with a pagetable about to be destroyed. */
124 uint16_t pad[3]; /* align next field on 8-byte boundary */
125 /* guest physical address of the toplevel pagetable dying */
127};
130
131/* Get the current Xen time, in nanoseconds since system boot. */
132#define HVMOP_get_time 10
134 uint64_t now; /* OUT */
135};
138
139#define HVMOP_xentrace 11
146
147/* Following tools-only interfaces may change in future. */
148#if defined(__XEN__) || defined(__XEN_TOOLS__)
149
150/* Deprecated by XENMEM_access_op_set_access */
151#define HVMOP_set_mem_access 12
152
153/* Deprecated by XENMEM_access_op_get_access */
154#define HVMOP_get_mem_access 13
155
156#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
157
158#define HVMOP_get_mem_type 15
159/* Return hvmmem_type_t for the specified pfn. */
161 /* Domain to be queried. */
163 /* OUT variable. */
165 uint16_t pad[2]; /* align next field on 8-byte boundary */
166 /* IN variable. */
168};
171
172/* Following tools-only interfaces may change in future. */
173#if defined(__XEN__) || defined(__XEN_TOOLS__)
174
175/*
176 * Definitions relating to DMOP_create_ioreq_server. (Defined here for
177 * backwards compatibility).
178 */
179
180#define HVM_IOREQSRV_BUFIOREQ_OFF 0
181#define HVM_IOREQSRV_BUFIOREQ_LEGACY 1
182/*
183 * Use this when read_pointer gets updated atomically and
184 * the pointer pair gets read atomically:
185 */
186#define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
187
188#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
189
190#if defined(__i386__) || defined(__x86_64__)
191
192/*
193 * HVMOP_set_evtchn_upcall_vector: Set a <vector> that should be used for event
194 * channel upcalls on the specified <vcpu>. If set,
195 * this vector will be used in preference to the
196 * domain global callback via (see
197 * HVM_PARAM_CALLBACK_IRQ).
198 */
199#define HVMOP_set_evtchn_upcall_vector 23
200struct xen_hvm_evtchn_upcall_vector {
201 uint32_t vcpu;
203};
204typedef struct xen_hvm_evtchn_upcall_vector xen_hvm_evtchn_upcall_vector_t;
205DEFINE_XEN_GUEST_HANDLE(xen_hvm_evtchn_upcall_vector_t);
206
207#endif /* defined(__i386__) || defined(__x86_64__) */
208
209#define HVMOP_guest_request_vm_event 24
210
211/* HVMOP_altp2m: perform altp2m state operations */
212#define HVMOP_altp2m 25
213
214#define HVMOP_ALTP2M_INTERFACE_VERSION 0x00000001
215
217 /* IN or OUT variable on/off */
219};
222
231
237
239 /* IN/OUT variable */
241 uint16_t hvmmem_default_access; /* xenmem_access_t */
242};
245
246#if __XEN_INTERFACE_VERSION__ < 0x00040a00
248 /* view */
250 /* Memory type */
251 uint16_t access; /* xenmem_access_t */
253 /* gfn */
255};
258#endif /* __XEN_INTERFACE_VERSION__ < 0x00040a00 */
259
261 /* view */
263 /* Memory type */
264 uint16_t access; /* xenmem_access_t */
266 /* gfn */
268};
271
273 /* view */
276 /* Number of pages */
278 /*
279 * Used for continuation purposes.
280 * Must be set to zero upon initial invocation.
281 */
283 /* List of pfns to set access for */
284 XEN_GUEST_HANDLE(const_uint64) pfn_list;
285 /* Corresponding list of access settings for pfn_list */
286 XEN_GUEST_HANDLE(const_uint8) access_list;
287};
288
290 /* view */
294 /* old gfn */
296 /* new gfn, INVALID_GFN (~0UL) means revert */
298};
301
306
312
314 uint32_t version; /* HVMOP_ALTP2M_INTERFACE_VERSION */
316/* Get/set the altp2m state for a domain */
317#define HVMOP_altp2m_get_domain_state 1
318#define HVMOP_altp2m_set_domain_state 2
319/* Set a given VCPU to receive altp2m event notifications */
320#define HVMOP_altp2m_vcpu_enable_notify 3
321/* Create a new view */
322#define HVMOP_altp2m_create_p2m 4
323/* Destroy a view */
324#define HVMOP_altp2m_destroy_p2m 5
325/* Switch view for an entire domain */
326#define HVMOP_altp2m_switch_p2m 6
327/* Notify that a page of memory is to have specific access types */
328#define HVMOP_altp2m_set_mem_access 7
329/* Change a p2m entry to have a different gfn->mfn mapping */
330#define HVMOP_altp2m_change_gfn 8
331/* Set access for an array of pages */
332#define HVMOP_altp2m_set_mem_access_multi 9
333/* Set the "Suppress #VE" bit on a page */
334#define HVMOP_altp2m_set_suppress_ve 10
335/* Get the "Suppress #VE" bit of a page */
336#define HVMOP_altp2m_get_suppress_ve 11
337/* Get the access of a page of memory from a certain view */
338#define HVMOP_altp2m_get_mem_access 12
339/* Disable altp2m event notifications for a given VCPU */
340#define HVMOP_altp2m_vcpu_disable_notify 13
341/* Get the active vcpu p2m index */
342#define HVMOP_altp2m_get_p2m_idx 14
343/* Set the "Supress #VE" bit for a range of pages */
344#define HVMOP_altp2m_set_suppress_ve_multi 15
345/* Set visibility for a given altp2m view */
346#define HVMOP_altp2m_set_visibility 16
350 union {
354#if __XEN_INTERFACE_VERSION__ < 0x00040a00
356#endif /* __XEN_INTERFACE_VERSION__ < 0x00040a00 */
366 } u;
367};
370
371#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
372
373/*
374 * Local variables:
375 * mode: C
376 * c-file-style: "BSD"
377 * c-basic-offset: 4
378 * tab-width: 4
379 * indent-tabs-mode: nil
380 * End:
381 */
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned long long uint64_t
Definition stdint.h:13
signed int int32_t
Definition stdint.h:17
unsigned char uint8_t
Definition stdint.h:10
union @104331263140136355135267063077374276003064103115 u
uint32_t vector
MSI-X vector.
Definition ena.h:9
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
hvmmem_type_t
Definition hvm_op.h:98
@ HVMMEM_mmio_write_dm
Definition hvm_op.h:103
@ HVMMEM_mmio_dm
Definition hvm_op.h:101
@ HVMMEM_ram_ro
Definition hvm_op.h:100
@ HVMMEM_ioreq_server
Definition hvm_op.h:108
@ HVMMEM_ram_rw
Definition hvm_op.h:99
struct xen_hvm_altp2m_view xen_hvm_altp2m_view_t
Definition hvm_op.h:243
struct xen_hvm_set_pci_link_route xen_hvm_set_pci_link_route_t
Definition hvm_op.h:83
struct xen_hvm_altp2m_mem_access xen_hvm_altp2m_mem_access_t
Definition hvm_op.h:269
struct xen_hvm_get_mem_type xen_hvm_get_mem_type_t
Definition hvm_op.h:169
struct xen_hvm_altp2m_change_gfn xen_hvm_altp2m_change_gfn_t
Definition hvm_op.h:299
struct xen_hvm_get_time xen_hvm_get_time_t
Definition hvm_op.h:136
struct xen_hvm_altp2m_op xen_hvm_altp2m_op_t
Definition hvm_op.h:368
struct xen_hvm_set_pci_intx_level xen_hvm_set_pci_intx_level_t
Definition hvm_op.h:58
struct xen_hvm_set_isa_irq_level xen_hvm_set_isa_irq_level_t
Definition hvm_op.h:71
struct xen_hvm_altp2m_vcpu_disable_notify xen_hvm_altp2m_vcpu_disable_notify_t
Definition hvm_op.h:235
struct xen_hvm_altp2m_set_mem_access xen_hvm_altp2m_set_mem_access_t
Definition hvm_op.h:256
struct xen_hvm_altp2m_vcpu_enable_notify xen_hvm_altp2m_vcpu_enable_notify_t
Definition hvm_op.h:229
struct xen_hvm_altp2m_domain_state xen_hvm_altp2m_domain_state_t
Definition hvm_op.h:220
struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t
Definition hvm_op.h:128
struct xen_hvm_param xen_hvm_param_t
Definition hvm_op.h:25
struct xen_hvm_xentrace xen_hvm_xentrace_t
Definition hvm_op.h:144
uint16_t domid_t
Definition xen.h:622
#define DEFINE_XEN_GUEST_HANDLE(name)
Definition nonxen.h:26
uint32_t version
Definition hvm_op.h:314
uint32_t cmd
Definition hvm_op.h:315
struct xen_hvm_altp2m_set_mem_access_multi set_mem_access_multi
Definition hvm_op.h:359
struct xen_hvm_altp2m_mem_access mem_access
Definition hvm_op.h:357
struct xen_hvm_altp2m_vcpu_enable_notify enable_notify
Definition hvm_op.h:352
uint8_t pad[64]
Definition hvm_op.h:365
struct xen_hvm_altp2m_domain_state domain_state
Definition hvm_op.h:351
struct xen_hvm_altp2m_vcpu_disable_notify disable_notify
Definition hvm_op.h:362
uint16_t pad1
Definition hvm_op.h:348
domid_t domain
Definition hvm_op.h:347
struct xen_hvm_altp2m_suppress_ve_multi suppress_ve_multi
Definition hvm_op.h:361
struct xen_hvm_altp2m_get_vcpu_p2m_idx get_vcpu_p2m_idx
Definition hvm_op.h:363
struct xen_hvm_altp2m_set_visibility set_visibility
Definition hvm_op.h:364
struct xen_hvm_altp2m_view view
Definition hvm_op.h:353
uint32_t pad2
Definition hvm_op.h:349
struct xen_hvm_altp2m_set_mem_access set_mem_access
Definition hvm_op.h:355
struct xen_hvm_altp2m_suppress_ve suppress_ve
Definition hvm_op.h:360
struct xen_hvm_altp2m_change_gfn change_gfn
Definition hvm_op.h:358
XEN_GUEST_HANDLE(const_uint8) access_list
XEN_GUEST_HANDLE(const_uint64) pfn_list
uint16_t hvmmem_default_access
Definition hvm_op.h:241
uint16_t pad[2]
Definition hvm_op.h:165
uint16_t mem_type
Definition hvm_op.h:164
uint64_t now
Definition hvm_op.h:134
uint16_t pad
Definition hvm_op.h:21
uint32_t index
Definition hvm_op.h:22
domid_t domid
Definition hvm_op.h:20
uint64_t value
Definition hvm_op.h:23
uint16_t event
Definition hvm_op.h:141
uint8_t extra[TRACE_EXTRA_MAX *sizeof(uint32_t)]
Definition hvm_op.h:142
uint16_t extra_bytes
Definition hvm_op.h:141
#define TRACE_EXTRA_MAX
Definition trace.h:15