iPXE
params.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_PARAMS_H__
7#define __XEN_PUBLIC_HVM_PARAMS_H__
8
10FILE_SECBOOT ( PERMITTED );
11
12#include "hvm_op.h"
13
14/* These parameters are deprecated and their meaning is undefined. */
15#if defined(__XEN__) || defined(__XEN_TOOLS__)
16
17#define HVM_PARAM_PAE_ENABLED 4
18#define HVM_PARAM_DM_DOMAIN 13
19#define HVM_PARAM_MEMORY_EVENT_CR0 20
20#define HVM_PARAM_MEMORY_EVENT_CR3 21
21#define HVM_PARAM_MEMORY_EVENT_CR4 22
22#define HVM_PARAM_MEMORY_EVENT_INT3 23
23#define HVM_PARAM_NESTEDHVM 24
24#define HVM_PARAM_MEMORY_EVENT_SINGLE_STEP 25
25#define HVM_PARAM_BUFIOREQ_EVTCHN 26
26#define HVM_PARAM_MEMORY_EVENT_MSR 30
27
28#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
29
30/*
31 * Parameter space for HVMOP_{set,get}_param.
32 */
33
34#define HVM_PARAM_CALLBACK_IRQ 0
35#define HVM_PARAM_CALLBACK_IRQ_TYPE_MASK xen_mk_ullong(0xFF00000000000000)
36/*
37 * How should CPU0 event-channel notifications be delivered?
38 *
39 * If val == 0 then CPU0 event-channel notifications are not delivered.
40 * If val != 0, val[63:56] encodes the type, as follows:
41 */
42
43#define HVM_PARAM_CALLBACK_TYPE_GSI 0
44/*
45 * val[55:0] is a delivery GSI. GSI 0 cannot be used, as it aliases val == 0,
46 * and disables all notifications.
47 */
48
49#define HVM_PARAM_CALLBACK_TYPE_PCI_INTX 1
50/*
51 * val[55:0] is a delivery PCI INTx line:
52 * Domain = val[47:32], Bus = val[31:16] DevFn = val[15:8], IntX = val[1:0]
53 */
54
55#if defined(__i386__) || defined(__x86_64__)
56#define HVM_PARAM_CALLBACK_TYPE_VECTOR 2
57/*
58 * val[7:0] is a vector number. Check for XENFEAT_hvm_callback_vector to know
59 * if this delivery method is available.
60 */
61#elif defined(__arm__) || defined(__aarch64__)
62#define HVM_PARAM_CALLBACK_TYPE_PPI 2
63/*
64 * val[55:16] needs to be zero.
65 * val[15:8] is interrupt flag of the PPI used by event-channel:
66 * bit 8: the PPI is edge(1) or level(0) triggered
67 * bit 9: the PPI is active low(1) or high(0)
68 * val[7:0] is a PPI number used by event-channel.
69 * This is only used by ARM/ARM64 and masking/eoi the interrupt associated to
70 * the notification is handled by the interrupt controller.
71 */
72#define HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_MASK 0xFF00
73#define HVM_PARAM_CALLBACK_TYPE_PPI_FLAG_LOW_LEVEL 2
74#endif
75
76/*
77 * These are not used by Xen. They are here for convenience of HVM-guest
78 * xenbus implementations.
79 */
80#define HVM_PARAM_STORE_PFN 1
81#define HVM_PARAM_STORE_EVTCHN 2
82
83#define HVM_PARAM_IOREQ_PFN 5
84
85#define HVM_PARAM_BUFIOREQ_PFN 6
86
87#if defined(__i386__) || defined(__x86_64__)
88
89/*
90 * Viridian enlightenments
91 *
92 * (See http://download.microsoft.com/download/A/B/4/AB43A34E-BDD0-4FA6-BDEF-79EEF16E880B/Hypervisor%20Top%20Level%20Functional%20Specification%20v4.0.docx)
93 *
94 * To expose viridian enlightenments to the guest set this parameter
95 * to the desired feature mask. The base feature set must be present
96 * in any valid feature mask.
97 */
98#define HVM_PARAM_VIRIDIAN 9
99
100/* Base+Freq viridian feature sets:
101 *
102 * - Hypercall MSRs (HV_X64_MSR_GUEST_OS_ID and HV_X64_MSR_HYPERCALL)
103 * - APIC access MSRs (HV_X64_MSR_EOI, HV_X64_MSR_ICR and HV_X64_MSR_TPR)
104 * - Virtual Processor index MSR (HV_X64_MSR_VP_INDEX)
105 * - Timer frequency MSRs (HV_X64_MSR_TSC_FREQUENCY and
106 * HV_X64_MSR_APIC_FREQUENCY)
107 */
108#define _HVMPV_base_freq 0
109#define HVMPV_base_freq (1 << _HVMPV_base_freq)
110
111/* Feature set modifications */
112
113/* Disable timer frequency MSRs (HV_X64_MSR_TSC_FREQUENCY and
114 * HV_X64_MSR_APIC_FREQUENCY).
115 * This modification restores the viridian feature set to the
116 * original 'base' set exposed in releases prior to Xen 4.4.
117 */
118#define _HVMPV_no_freq 1
119#define HVMPV_no_freq (1 << _HVMPV_no_freq)
120
121/* Enable Partition Time Reference Counter (HV_X64_MSR_TIME_REF_COUNT) */
122#define _HVMPV_time_ref_count 2
123#define HVMPV_time_ref_count (1 << _HVMPV_time_ref_count)
124
125/* Enable Reference TSC Page (HV_X64_MSR_REFERENCE_TSC) */
126#define _HVMPV_reference_tsc 3
127#define HVMPV_reference_tsc (1 << _HVMPV_reference_tsc)
128
129/* Use Hypercall for remote TLB flush */
130#define _HVMPV_hcall_remote_tlb_flush 4
131#define HVMPV_hcall_remote_tlb_flush (1 << _HVMPV_hcall_remote_tlb_flush)
132
133/* Use APIC assist */
134#define _HVMPV_apic_assist 5
135#define HVMPV_apic_assist (1 << _HVMPV_apic_assist)
136
137/* Enable crash MSRs */
138#define _HVMPV_crash_ctl 6
139#define HVMPV_crash_ctl (1 << _HVMPV_crash_ctl)
140
141/* Enable SYNIC MSRs */
142#define _HVMPV_synic 7
143#define HVMPV_synic (1 << _HVMPV_synic)
144
145/* Enable STIMER MSRs */
146#define _HVMPV_stimer 8
147#define HVMPV_stimer (1 << _HVMPV_stimer)
148
149/* Use Synthetic Cluster IPI Hypercall */
150#define _HVMPV_hcall_ipi 9
151#define HVMPV_hcall_ipi (1 << _HVMPV_hcall_ipi)
152
153/* Enable ExProcessorMasks */
154#define _HVMPV_ex_processor_masks 10
155#define HVMPV_ex_processor_masks (1 << _HVMPV_ex_processor_masks)
156
157/* Allow more than 64 VPs */
158#define _HVMPV_no_vp_limit 11
159#define HVMPV_no_vp_limit (1 << _HVMPV_no_vp_limit)
160
161/* Enable vCPU hotplug */
162#define _HVMPV_cpu_hotplug 12
163#define HVMPV_cpu_hotplug (1 << _HVMPV_cpu_hotplug)
164
165#define HVMPV_feature_mask \
166 (HVMPV_base_freq | \
167 HVMPV_no_freq | \
168 HVMPV_time_ref_count | \
169 HVMPV_reference_tsc | \
170 HVMPV_hcall_remote_tlb_flush | \
171 HVMPV_apic_assist | \
172 HVMPV_crash_ctl | \
173 HVMPV_synic | \
174 HVMPV_stimer | \
175 HVMPV_hcall_ipi | \
176 HVMPV_ex_processor_masks | \
177 HVMPV_no_vp_limit | \
178 HVMPV_cpu_hotplug)
179
180#endif
181
182/*
183 * Set mode for virtual timers (currently x86 only):
184 * delay_for_missed_ticks (default):
185 * Do not advance a vcpu's time beyond the correct delivery time for
186 * interrupts that have been missed due to preemption. Deliver missed
187 * interrupts when the vcpu is rescheduled and advance the vcpu's virtual
188 * time stepwise for each one.
189 * no_delay_for_missed_ticks:
190 * As above, missed interrupts are delivered, but guest time always tracks
191 * wallclock (i.e., real) time while doing so.
192 * no_missed_ticks_pending:
193 * No missed interrupts are held pending. Instead, to ensure ticks are
194 * delivered at some non-zero rate, if we detect missed ticks then the
195 * internal tick alarm is not disabled if the VCPU is preempted during the
196 * next tick period.
197 * one_missed_tick_pending:
198 * Missed interrupts are collapsed together and delivered as one 'late tick'.
199 * Guest time always tracks wallclock (i.e., real) time.
200 */
201#define HVM_PARAM_TIMER_MODE 10
202#define HVMPTM_delay_for_missed_ticks 0
203#define HVMPTM_no_delay_for_missed_ticks 1
204#define HVMPTM_no_missed_ticks_pending 2
205#define HVMPTM_one_missed_tick_pending 3
206
207/* Boolean: Enable virtual HPET (high-precision event timer)? (x86-only) */
208#define HVM_PARAM_HPET_ENABLED 11
209
210/* Identity-map page directory used by Intel EPT when CR0.PG=0. */
211#define HVM_PARAM_IDENT_PT 12
212
213/* ACPI S state: currently support S0 and S3 on x86. */
214#define HVM_PARAM_ACPI_S_STATE 14
215
216/* TSS used on Intel when CR0.PE=0. */
217#define HVM_PARAM_VM86_TSS 15
218
219/* Boolean: Enable aligning all periodic vpts to reduce interrupts */
220#define HVM_PARAM_VPT_ALIGN 16
221
222/* Console debug shared memory ring and event channel */
223#define HVM_PARAM_CONSOLE_PFN 17
224#define HVM_PARAM_CONSOLE_EVTCHN 18
225
226/*
227 * Select location of ACPI PM1a and TMR control blocks. Currently two locations
228 * are supported, specified by version 0 or 1 in this parameter:
229 * - 0: default, use the old addresses
230 * PM1A_EVT == 0x1f40; PM1A_CNT == 0x1f44; PM_TMR == 0x1f48
231 * - 1: use the new default qemu addresses
232 * PM1A_EVT == 0xb000; PM1A_CNT == 0xb004; PM_TMR == 0xb008
233 * You can find these address definitions in <hvm/ioreq.h>
234 */
235#define HVM_PARAM_ACPI_IOPORTS_LOCATION 19
236
237/* Params for the mem event rings */
238#define HVM_PARAM_PAGING_RING_PFN 27
239#define HVM_PARAM_MONITOR_RING_PFN 28
240#define HVM_PARAM_SHARING_RING_PFN 29
241
242/* SHUTDOWN_* action in case of a triple fault */
243#define HVM_PARAM_TRIPLE_FAULT_REASON 31
244
245#define HVM_PARAM_IOREQ_SERVER_PFN 32
246#define HVM_PARAM_NR_IOREQ_SERVER_PAGES 33
247
248/* Location of the VM Generation ID in guest physical address space. */
249#define HVM_PARAM_VM_GENERATION_ID_ADDR 34
250
251/*
252 * Get mode for altp2m:
253 * disabled: altp2m not active (default)
254 * mixed: allow access to all altp2m ops for both in-guest and external tools
255 * external: allow access to external privileged tools only
256 * limited: guest only has limited access (ie. control VMFUNC and #VE)
257 */
258#define HVM_PARAM_ALTP2M 35
259#define XEN_ALTP2M_disabled 0
260#define XEN_ALTP2M_mixed 1
261#define XEN_ALTP2M_external 2
262#define XEN_ALTP2M_limited 3
263
264/*
265 * Size of the x87 FPU FIP/FDP registers that the hypervisor needs to
266 * save/restore. This is a workaround for a hardware limitation that
267 * does not allow the full FIP/FDP and FCS/FDS to be restored.
268 *
269 * Valid values are:
270 *
271 * 8: save/restore 64-bit FIP/FDP and clear FCS/FDS (default if CPU
272 * has FPCSDS feature).
273 *
274 * 4: save/restore 32-bit FIP/FDP, FCS/FDS, and clear upper 32-bits of
275 * FIP/FDP.
276 *
277 * 0: allow hypervisor to choose based on the value of FIP/FDP
278 * (default if CPU does not have FPCSDS).
279 *
280 * If FPCSDS (bit 13 in CPUID leaf 0x7, subleaf 0x0) is set, the CPU
281 * never saves FCS/FDS and this parameter should be left at the
282 * default of 8.
283 */
284#define HVM_PARAM_X87_FIP_WIDTH 36
285
286/*
287 * TSS (and its size) used on Intel when CR0.PE=0. The address occupies
288 * the low 32 bits, while the size is in the high 32 ones.
289 */
290#define HVM_PARAM_VM86_TSS_SIZED 37
291
292/* Enable MCA capabilities. */
293#define HVM_PARAM_MCA_CAP 38
294#define XEN_HVM_MCA_CAP_LMCE (xen_mk_ullong(1) << 0)
295#define XEN_HVM_MCA_CAP_MASK XEN_HVM_MCA_CAP_LMCE
296
297#define HVM_NR_PARAMS 39
298
299#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
#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