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_PARAMS_H__
228c2ecf20Sopenharmony_ci#define __XEN_PUBLIC_HVM_PARAMS_H__
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#include <xen/interface/hvm/hvm_op.h>
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/*
278c2ecf20Sopenharmony_ci * Parameter space for HVMOP_{set,get}_param.
288c2ecf20Sopenharmony_ci */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define HVM_PARAM_CALLBACK_IRQ 0
318c2ecf20Sopenharmony_ci/*
328c2ecf20Sopenharmony_ci * How should CPU0 event-channel notifications be delivered?
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci * If val == 0 then CPU0 event-channel notifications are not delivered.
358c2ecf20Sopenharmony_ci * If val != 0, val[63:56] encodes the type, as follows:
368c2ecf20Sopenharmony_ci */
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define HVM_PARAM_CALLBACK_TYPE_GSI      0
398c2ecf20Sopenharmony_ci/*
408c2ecf20Sopenharmony_ci * val[55:0] is a delivery GSI.  GSI 0 cannot be used, as it aliases val == 0,
418c2ecf20Sopenharmony_ci * and disables all notifications.
428c2ecf20Sopenharmony_ci */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define HVM_PARAM_CALLBACK_TYPE_PCI_INTX 1
458c2ecf20Sopenharmony_ci/*
468c2ecf20Sopenharmony_ci * val[55:0] is a delivery PCI INTx line:
478c2ecf20Sopenharmony_ci * Domain = val[47:32], Bus = val[31:16] DevFn = val[15:8], IntX = val[1:0]
488c2ecf20Sopenharmony_ci */
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#if defined(__i386__) || defined(__x86_64__)
518c2ecf20Sopenharmony_ci#define HVM_PARAM_CALLBACK_TYPE_VECTOR   2
528c2ecf20Sopenharmony_ci/*
538c2ecf20Sopenharmony_ci * val[7:0] is a vector number.  Check for XENFEAT_hvm_callback_vector to know
548c2ecf20Sopenharmony_ci * if this delivery method is available.
558c2ecf20Sopenharmony_ci */
568c2ecf20Sopenharmony_ci#elif defined(__arm__) || defined(__aarch64__)
578c2ecf20Sopenharmony_ci#define HVM_PARAM_CALLBACK_TYPE_PPI      2
588c2ecf20Sopenharmony_ci/*
598c2ecf20Sopenharmony_ci * val[55:16] needs to be zero.
608c2ecf20Sopenharmony_ci * val[15:8] is interrupt flag of the PPI used by event-channel:
618c2ecf20Sopenharmony_ci *  bit 8: the PPI is edge(1) or level(0) triggered
628c2ecf20Sopenharmony_ci *  bit 9: the PPI is active low(1) or high(0)
638c2ecf20Sopenharmony_ci * val[7:0] is a PPI number used by event-channel.
648c2ecf20Sopenharmony_ci * This is only used by ARM/ARM64 and masking/eoi the interrupt associated to
658c2ecf20Sopenharmony_ci * the notification is handled by the interrupt controller.
668c2ecf20Sopenharmony_ci */
678c2ecf20Sopenharmony_ci#endif
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define HVM_PARAM_STORE_PFN    1
708c2ecf20Sopenharmony_ci#define HVM_PARAM_STORE_EVTCHN 2
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#define HVM_PARAM_PAE_ENABLED  4
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define HVM_PARAM_IOREQ_PFN    5
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define HVM_PARAM_BUFIOREQ_PFN 6
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci/*
798c2ecf20Sopenharmony_ci * Set mode for virtual timers (currently x86 only):
808c2ecf20Sopenharmony_ci *  delay_for_missed_ticks (default):
818c2ecf20Sopenharmony_ci *   Do not advance a vcpu's time beyond the correct delivery time for
828c2ecf20Sopenharmony_ci *   interrupts that have been missed due to preemption. Deliver missed
838c2ecf20Sopenharmony_ci *   interrupts when the vcpu is rescheduled and advance the vcpu's virtual
848c2ecf20Sopenharmony_ci *   time stepwise for each one.
858c2ecf20Sopenharmony_ci *  no_delay_for_missed_ticks:
868c2ecf20Sopenharmony_ci *   As above, missed interrupts are delivered, but guest time always tracks
878c2ecf20Sopenharmony_ci *   wallclock (i.e., real) time while doing so.
888c2ecf20Sopenharmony_ci *  no_missed_ticks_pending:
898c2ecf20Sopenharmony_ci *   No missed interrupts are held pending. Instead, to ensure ticks are
908c2ecf20Sopenharmony_ci *   delivered at some non-zero rate, if we detect missed ticks then the
918c2ecf20Sopenharmony_ci *   internal tick alarm is not disabled if the VCPU is preempted during the
928c2ecf20Sopenharmony_ci *   next tick period.
938c2ecf20Sopenharmony_ci *  one_missed_tick_pending:
948c2ecf20Sopenharmony_ci *   Missed interrupts are collapsed together and delivered as one 'late tick'.
958c2ecf20Sopenharmony_ci *   Guest time always tracks wallclock (i.e., real) time.
968c2ecf20Sopenharmony_ci */
978c2ecf20Sopenharmony_ci#define HVM_PARAM_TIMER_MODE   10
988c2ecf20Sopenharmony_ci#define HVMPTM_delay_for_missed_ticks    0
998c2ecf20Sopenharmony_ci#define HVMPTM_no_delay_for_missed_ticks 1
1008c2ecf20Sopenharmony_ci#define HVMPTM_no_missed_ticks_pending   2
1018c2ecf20Sopenharmony_ci#define HVMPTM_one_missed_tick_pending   3
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci/* Boolean: Enable virtual HPET (high-precision event timer)? (x86-only) */
1048c2ecf20Sopenharmony_ci#define HVM_PARAM_HPET_ENABLED 11
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci/* Identity-map page directory used by Intel EPT when CR0.PG=0. */
1078c2ecf20Sopenharmony_ci#define HVM_PARAM_IDENT_PT     12
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci/* Device Model domain, defaults to 0. */
1108c2ecf20Sopenharmony_ci#define HVM_PARAM_DM_DOMAIN    13
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/* ACPI S state: currently support S0 and S3 on x86. */
1138c2ecf20Sopenharmony_ci#define HVM_PARAM_ACPI_S_STATE 14
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci/* TSS used on Intel when CR0.PE=0. */
1168c2ecf20Sopenharmony_ci#define HVM_PARAM_VM86_TSS     15
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci/* Boolean: Enable aligning all periodic vpts to reduce interrupts */
1198c2ecf20Sopenharmony_ci#define HVM_PARAM_VPT_ALIGN    16
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/* Console debug shared memory ring and event channel */
1228c2ecf20Sopenharmony_ci#define HVM_PARAM_CONSOLE_PFN    17
1238c2ecf20Sopenharmony_ci#define HVM_PARAM_CONSOLE_EVTCHN 18
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define HVM_NR_PARAMS          19
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
128