| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,202 @@ | ||
| /****************************************************************************** | ||
| * sched.h | ||
| * | ||
| * Scheduler state interactions | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to | ||
| * deal in the Software without restriction, including without limitation the | ||
| * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| * sell copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| * DEALINGS IN THE SOFTWARE. | ||
| * | ||
| * Copyright (c) 2005, Keir Fraser <keir@xensource.com> | ||
| */ | ||
|
|
||
| #ifndef __XEN_PUBLIC_SCHED_H__ | ||
| #define __XEN_PUBLIC_SCHED_H__ | ||
|
|
||
| #include "event_channel.h" | ||
|
|
||
| /* | ||
| * `incontents 150 sched Guest Scheduler Operations | ||
| * | ||
| * The SCHEDOP interface provides mechanisms for a guest to interact | ||
| * with the scheduler, including yield, blocking and shutting itself | ||
| * down. | ||
| */ | ||
|
|
||
| /* | ||
| * The prototype for this hypercall is: | ||
| * ` long HYPERVISOR_sched_op(enum sched_op cmd, void *arg, ...) | ||
| * | ||
| * @cmd == SCHEDOP_??? (scheduler operation). | ||
| * @arg == Operation-specific extra argument(s), as described below. | ||
| * ... == Additional Operation-specific extra arguments, described below. | ||
| * | ||
| * Versions of Xen prior to 3.0.2 provided only the following legacy version | ||
| * of this hypercall, supporting only the commands yield, block and shutdown: | ||
| * long sched_op(int cmd, unsigned long arg) | ||
| * @cmd == SCHEDOP_??? (scheduler operation). | ||
| * @arg == 0 (SCHEDOP_yield and SCHEDOP_block) | ||
| * == SHUTDOWN_* code (SCHEDOP_shutdown) | ||
| * | ||
| * This legacy version is available to new guests as: | ||
| * ` long HYPERVISOR_sched_op_compat(enum sched_op cmd, unsigned long arg) | ||
| */ | ||
|
|
||
| /* ` enum sched_op { // SCHEDOP_* => struct sched_* */ | ||
| /* | ||
| * Voluntarily yield the CPU. | ||
| * @arg == NULL. | ||
| */ | ||
| #define SCHEDOP_yield 0 | ||
|
|
||
| /* | ||
| * Block execution of this VCPU until an event is received for processing. | ||
| * If called with event upcalls masked, this operation will atomically | ||
| * reenable event delivery and check for pending events before blocking the | ||
| * VCPU. This avoids a "wakeup waiting" race. | ||
| * @arg == NULL. | ||
| */ | ||
| #define SCHEDOP_block 1 | ||
|
|
||
| /* | ||
| * Halt execution of this domain (all VCPUs) and notify the system controller. | ||
| * @arg == pointer to sched_shutdown_t structure. | ||
| * | ||
| * If the sched_shutdown_t reason is SHUTDOWN_suspend then | ||
| * x86 PV guests must also set RDX (EDX for 32-bit guests) to the MFN | ||
| * of the guest's start info page. RDX/EDX is the third hypercall | ||
| * argument. | ||
| * | ||
| * In addition, which reason is SHUTDOWN_suspend this hypercall | ||
| * returns 1 if suspend was cancelled or the domain was merely | ||
| * checkpointed, and 0 if it is resuming in a new domain. | ||
| */ | ||
| #define SCHEDOP_shutdown 2 | ||
|
|
||
| /* | ||
| * Poll a set of event-channel ports. Return when one or more are pending. An | ||
| * optional timeout may be specified. | ||
| * @arg == pointer to sched_poll_t structure. | ||
| */ | ||
| #define SCHEDOP_poll 3 | ||
|
|
||
| /* | ||
| * Declare a shutdown for another domain. The main use of this function is | ||
| * in interpreting shutdown requests and reasons for fully-virtualized | ||
| * domains. A para-virtualized domain may use SCHEDOP_shutdown directly. | ||
| * @arg == pointer to sched_remote_shutdown_t structure. | ||
| */ | ||
| #define SCHEDOP_remote_shutdown 4 | ||
|
|
||
| /* | ||
| * Latch a shutdown code, so that when the domain later shuts down it | ||
| * reports this code to the control tools. | ||
| * @arg == sched_shutdown_t, as for SCHEDOP_shutdown. | ||
| */ | ||
| #define SCHEDOP_shutdown_code 5 | ||
|
|
||
| /* | ||
| * Setup, poke and destroy a domain watchdog timer. | ||
| * @arg == pointer to sched_watchdog_t structure. | ||
| * With id == 0, setup a domain watchdog timer to cause domain shutdown | ||
| * after timeout, returns watchdog id. | ||
| * With id != 0 and timeout == 0, destroy domain watchdog timer. | ||
| * With id != 0 and timeout != 0, poke watchdog timer and set new timeout. | ||
| */ | ||
| #define SCHEDOP_watchdog 6 | ||
|
|
||
| /* | ||
| * Override the current vcpu affinity by pinning it to one physical cpu or | ||
| * undo this override restoring the previous affinity. | ||
| * @arg == pointer to sched_pin_override_t structure. | ||
| * | ||
| * A negative pcpu value will undo a previous pin override and restore the | ||
| * previous cpu affinity. | ||
| * This call is allowed for the hardware domain only and requires the cpu | ||
| * to be part of the domain's cpupool. | ||
| */ | ||
| #define SCHEDOP_pin_override 7 | ||
| /* ` } */ | ||
|
|
||
| struct sched_shutdown { | ||
| unsigned int reason; /* SHUTDOWN_* => enum sched_shutdown_reason */ | ||
| }; | ||
| typedef struct sched_shutdown sched_shutdown_t; | ||
| DEFINE_XEN_GUEST_HANDLE(sched_shutdown_t); | ||
|
|
||
| struct sched_poll { | ||
| XEN_GUEST_HANDLE(evtchn_port_t) ports; | ||
| unsigned int nr_ports; | ||
| uint64_t timeout; | ||
| }; | ||
| typedef struct sched_poll sched_poll_t; | ||
| DEFINE_XEN_GUEST_HANDLE(sched_poll_t); | ||
|
|
||
| struct sched_remote_shutdown { | ||
| domid_t domain_id; /* Remote domain ID */ | ||
| unsigned int reason; /* SHUTDOWN_* => enum sched_shutdown_reason */ | ||
| }; | ||
| typedef struct sched_remote_shutdown sched_remote_shutdown_t; | ||
| DEFINE_XEN_GUEST_HANDLE(sched_remote_shutdown_t); | ||
|
|
||
| struct sched_watchdog { | ||
| uint32_t id; /* watchdog ID */ | ||
| uint32_t timeout; /* timeout */ | ||
| }; | ||
| typedef struct sched_watchdog sched_watchdog_t; | ||
| DEFINE_XEN_GUEST_HANDLE(sched_watchdog_t); | ||
|
|
||
| struct sched_pin_override { | ||
| int32_t pcpu; | ||
| }; | ||
| typedef struct sched_pin_override sched_pin_override_t; | ||
| DEFINE_XEN_GUEST_HANDLE(sched_pin_override_t); | ||
|
|
||
| /* | ||
| * Reason codes for SCHEDOP_shutdown. These may be interpreted by control | ||
| * software to determine the appropriate action. For the most part, Xen does | ||
| * not care about the shutdown code. | ||
| */ | ||
| /* ` enum sched_shutdown_reason { */ | ||
| #define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */ | ||
| #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */ | ||
| #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ | ||
| #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ | ||
| #define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */ | ||
|
|
||
| /* | ||
| * Domain asked to perform 'soft reset' for it. The expected behavior is to | ||
| * reset internal Xen state for the domain returning it to the point where it | ||
| * was created but leaving the domain's memory contents and vCPU contexts | ||
| * intact. This will allow the domain to start over and set up all Xen specific | ||
| * interfaces again. | ||
| */ | ||
| #define SHUTDOWN_soft_reset 5 | ||
| #define SHUTDOWN_MAX 5 /* Maximum valid shutdown reason. */ | ||
| /* ` } */ | ||
|
|
||
| #endif /* __XEN_PUBLIC_SCHED_H__ */ | ||
|
|
||
| /* | ||
| * Local variables: | ||
| * mode: C | ||
| * c-file-style: "BSD" | ||
| * c-basic-offset: 4 | ||
| * tab-width: 4 | ||
| * indent-tabs-mode: nil | ||
| * End: | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,341 @@ | ||
| /****************************************************************************** | ||
| * include/public/trace.h | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to | ||
| * deal in the Software without restriction, including without limitation the | ||
| * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| * sell copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| * DEALINGS IN THE SOFTWARE. | ||
| * | ||
| * Mark Williamson, (C) 2004 Intel Research Cambridge | ||
| * Copyright (C) 2005 Bin Ren | ||
| */ | ||
|
|
||
| #ifndef __XEN_PUBLIC_TRACE_H__ | ||
| #define __XEN_PUBLIC_TRACE_H__ | ||
|
|
||
| #define TRACE_EXTRA_MAX 7 | ||
| #define TRACE_EXTRA_SHIFT 28 | ||
|
|
||
| /* Trace classes */ | ||
| #define TRC_CLS_SHIFT 16 | ||
| #define TRC_GEN 0x0001f000 /* General trace */ | ||
| #define TRC_SCHED 0x0002f000 /* Xen Scheduler trace */ | ||
| #define TRC_DOM0OP 0x0004f000 /* Xen DOM0 operation trace */ | ||
| #define TRC_HVM 0x0008f000 /* Xen HVM trace */ | ||
| #define TRC_MEM 0x0010f000 /* Xen memory trace */ | ||
| #define TRC_PV 0x0020f000 /* Xen PV traces */ | ||
| #define TRC_SHADOW 0x0040f000 /* Xen shadow tracing */ | ||
| #define TRC_HW 0x0080f000 /* Xen hardware-related traces */ | ||
| #define TRC_GUEST 0x0800f000 /* Guest-generated traces */ | ||
| #define TRC_ALL 0x0ffff000 | ||
| #define TRC_HD_TO_EVENT(x) ((x)&0x0fffffff) | ||
| #define TRC_HD_CYCLE_FLAG (1UL<<31) | ||
| #define TRC_HD_INCLUDES_CYCLE_COUNT(x) ( !!( (x) & TRC_HD_CYCLE_FLAG ) ) | ||
| #define TRC_HD_EXTRA(x) (((x)>>TRACE_EXTRA_SHIFT)&TRACE_EXTRA_MAX) | ||
|
|
||
| /* Trace subclasses */ | ||
| #define TRC_SUBCLS_SHIFT 12 | ||
|
|
||
| /* trace subclasses for SVM */ | ||
| #define TRC_HVM_ENTRYEXIT 0x00081000 /* VMENTRY and #VMEXIT */ | ||
| #define TRC_HVM_HANDLER 0x00082000 /* various HVM handlers */ | ||
| #define TRC_HVM_EMUL 0x00084000 /* emulated devices */ | ||
|
|
||
| #define TRC_SCHED_MIN 0x00021000 /* Just runstate changes */ | ||
| #define TRC_SCHED_CLASS 0x00022000 /* Scheduler-specific */ | ||
| #define TRC_SCHED_VERBOSE 0x00028000 /* More inclusive scheduling */ | ||
|
|
||
| /* | ||
| * The highest 3 bits of the last 12 bits of TRC_SCHED_CLASS above are | ||
| * reserved for encoding what scheduler produced the information. The | ||
| * actual event is encoded in the last 9 bits. | ||
| * | ||
| * This means we have 8 scheduling IDs available (which means at most 8 | ||
| * schedulers generating events) and, in each scheduler, up to 512 | ||
| * different events. | ||
| */ | ||
| #define TRC_SCHED_ID_BITS 3 | ||
| #define TRC_SCHED_ID_SHIFT (TRC_SUBCLS_SHIFT - TRC_SCHED_ID_BITS) | ||
| #define TRC_SCHED_ID_MASK (((1UL<<TRC_SCHED_ID_BITS) - 1) << TRC_SCHED_ID_SHIFT) | ||
| #define TRC_SCHED_EVT_MASK (~(TRC_SCHED_ID_MASK)) | ||
|
|
||
| /* Per-scheduler IDs, to identify scheduler specific events */ | ||
| #define TRC_SCHED_CSCHED 0 | ||
| #define TRC_SCHED_CSCHED2 1 | ||
| /* #define XEN_SCHEDULER_SEDF 2 (Removed) */ | ||
| #define TRC_SCHED_ARINC653 3 | ||
| #define TRC_SCHED_RTDS 4 | ||
| #define TRC_SCHED_SNULL 5 | ||
|
|
||
| /* Per-scheduler tracing */ | ||
| #define TRC_SCHED_CLASS_EVT(_c, _e) \ | ||
| ( ( TRC_SCHED_CLASS | \ | ||
| ((TRC_SCHED_##_c << TRC_SCHED_ID_SHIFT) & TRC_SCHED_ID_MASK) ) + \ | ||
| (_e & TRC_SCHED_EVT_MASK) ) | ||
|
|
||
| /* Trace classes for DOM0 operations */ | ||
| #define TRC_DOM0_DOMOPS 0x00041000 /* Domains manipulations */ | ||
|
|
||
| /* Trace classes for Hardware */ | ||
| #define TRC_HW_PM 0x00801000 /* Power management traces */ | ||
| #define TRC_HW_IRQ 0x00802000 /* Traces relating to the handling of IRQs */ | ||
|
|
||
| /* Trace events per class */ | ||
| #define TRC_LOST_RECORDS (TRC_GEN + 1) | ||
| #define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2) | ||
| #define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3) | ||
|
|
||
| #define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) | ||
| #define TRC_SCHED_CONTINUE_RUNNING (TRC_SCHED_MIN + 2) | ||
| #define TRC_SCHED_DOM_ADD (TRC_SCHED_VERBOSE + 1) | ||
| #define TRC_SCHED_DOM_REM (TRC_SCHED_VERBOSE + 2) | ||
| #define TRC_SCHED_SLEEP (TRC_SCHED_VERBOSE + 3) | ||
| #define TRC_SCHED_WAKE (TRC_SCHED_VERBOSE + 4) | ||
| #define TRC_SCHED_YIELD (TRC_SCHED_VERBOSE + 5) | ||
| #define TRC_SCHED_BLOCK (TRC_SCHED_VERBOSE + 6) | ||
| #define TRC_SCHED_SHUTDOWN (TRC_SCHED_VERBOSE + 7) | ||
| #define TRC_SCHED_CTL (TRC_SCHED_VERBOSE + 8) | ||
| #define TRC_SCHED_ADJDOM (TRC_SCHED_VERBOSE + 9) | ||
| #define TRC_SCHED_SWITCH (TRC_SCHED_VERBOSE + 10) | ||
| #define TRC_SCHED_S_TIMER_FN (TRC_SCHED_VERBOSE + 11) | ||
| #define TRC_SCHED_T_TIMER_FN (TRC_SCHED_VERBOSE + 12) | ||
| #define TRC_SCHED_DOM_TIMER_FN (TRC_SCHED_VERBOSE + 13) | ||
| #define TRC_SCHED_SWITCH_INFPREV (TRC_SCHED_VERBOSE + 14) | ||
| #define TRC_SCHED_SWITCH_INFNEXT (TRC_SCHED_VERBOSE + 15) | ||
| #define TRC_SCHED_SHUTDOWN_CODE (TRC_SCHED_VERBOSE + 16) | ||
| #define TRC_SCHED_SWITCH_INFCONT (TRC_SCHED_VERBOSE + 17) | ||
|
|
||
| #define TRC_DOM0_DOM_ADD (TRC_DOM0_DOMOPS + 1) | ||
| #define TRC_DOM0_DOM_REM (TRC_DOM0_DOMOPS + 2) | ||
|
|
||
| #define TRC_MEM_PAGE_GRANT_MAP (TRC_MEM + 1) | ||
| #define TRC_MEM_PAGE_GRANT_UNMAP (TRC_MEM + 2) | ||
| #define TRC_MEM_PAGE_GRANT_TRANSFER (TRC_MEM + 3) | ||
| #define TRC_MEM_SET_P2M_ENTRY (TRC_MEM + 4) | ||
| #define TRC_MEM_DECREASE_RESERVATION (TRC_MEM + 5) | ||
| #define TRC_MEM_POD_POPULATE (TRC_MEM + 16) | ||
| #define TRC_MEM_POD_ZERO_RECLAIM (TRC_MEM + 17) | ||
| #define TRC_MEM_POD_SUPERPAGE_SPLINTER (TRC_MEM + 18) | ||
|
|
||
| #define TRC_PV_ENTRY 0x00201000 /* Hypervisor entry points for PV guests. */ | ||
| #define TRC_PV_SUBCALL 0x00202000 /* Sub-call in a multicall hypercall */ | ||
|
|
||
| #define TRC_PV_HYPERCALL (TRC_PV_ENTRY + 1) | ||
| #define TRC_PV_TRAP (TRC_PV_ENTRY + 3) | ||
| #define TRC_PV_PAGE_FAULT (TRC_PV_ENTRY + 4) | ||
| #define TRC_PV_FORCED_INVALID_OP (TRC_PV_ENTRY + 5) | ||
| #define TRC_PV_EMULATE_PRIVOP (TRC_PV_ENTRY + 6) | ||
| #define TRC_PV_EMULATE_4GB (TRC_PV_ENTRY + 7) | ||
| #define TRC_PV_MATH_STATE_RESTORE (TRC_PV_ENTRY + 8) | ||
| #define TRC_PV_PAGING_FIXUP (TRC_PV_ENTRY + 9) | ||
| #define TRC_PV_GDT_LDT_MAPPING_FAULT (TRC_PV_ENTRY + 10) | ||
| #define TRC_PV_PTWR_EMULATION (TRC_PV_ENTRY + 11) | ||
| #define TRC_PV_PTWR_EMULATION_PAE (TRC_PV_ENTRY + 12) | ||
| #define TRC_PV_HYPERCALL_V2 (TRC_PV_ENTRY + 13) | ||
| #define TRC_PV_HYPERCALL_SUBCALL (TRC_PV_SUBCALL + 14) | ||
|
|
||
| /* | ||
| * TRC_PV_HYPERCALL_V2 format | ||
| * | ||
| * Only some of the hypercall argument are recorded. Bit fields A0 to | ||
| * A5 in the first extra word are set if the argument is present and | ||
| * the arguments themselves are packed sequentially in the following | ||
| * words. | ||
| * | ||
| * The TRC_64_FLAG bit is not set for these events (even if there are | ||
| * 64-bit arguments in the record). | ||
| * | ||
| * Word | ||
| * 0 bit 31 30|29 28|27 26|25 24|23 22|21 20|19 ... 0 | ||
| * A5 |A4 |A3 |A2 |A1 |A0 |Hypercall op | ||
| * 1 First 32 bit (or low word of first 64 bit) arg in record | ||
| * 2 Second 32 bit (or high word of first 64 bit) arg in record | ||
| * ... | ||
| * | ||
| * A0-A5 bitfield values: | ||
| * | ||
| * 00b Argument not present | ||
| * 01b 32-bit argument present | ||
| * 10b 64-bit argument present | ||
| * 11b Reserved | ||
| */ | ||
| #define TRC_PV_HYPERCALL_V2_ARG_32(i) (0x1 << (20 + 2*(i))) | ||
| #define TRC_PV_HYPERCALL_V2_ARG_64(i) (0x2 << (20 + 2*(i))) | ||
| #define TRC_PV_HYPERCALL_V2_ARG_MASK (0xfff00000) | ||
|
|
||
| #define TRC_SHADOW_NOT_SHADOW (TRC_SHADOW + 1) | ||
| #define TRC_SHADOW_FAST_PROPAGATE (TRC_SHADOW + 2) | ||
| #define TRC_SHADOW_FAST_MMIO (TRC_SHADOW + 3) | ||
| #define TRC_SHADOW_FALSE_FAST_PATH (TRC_SHADOW + 4) | ||
| #define TRC_SHADOW_MMIO (TRC_SHADOW + 5) | ||
| #define TRC_SHADOW_FIXUP (TRC_SHADOW + 6) | ||
| #define TRC_SHADOW_DOMF_DYING (TRC_SHADOW + 7) | ||
| #define TRC_SHADOW_EMULATE (TRC_SHADOW + 8) | ||
| #define TRC_SHADOW_EMULATE_UNSHADOW_USER (TRC_SHADOW + 9) | ||
| #define TRC_SHADOW_EMULATE_UNSHADOW_EVTINJ (TRC_SHADOW + 10) | ||
| #define TRC_SHADOW_EMULATE_UNSHADOW_UNHANDLED (TRC_SHADOW + 11) | ||
| #define TRC_SHADOW_WRMAP_BF (TRC_SHADOW + 12) | ||
| #define TRC_SHADOW_PREALLOC_UNPIN (TRC_SHADOW + 13) | ||
| #define TRC_SHADOW_RESYNC_FULL (TRC_SHADOW + 14) | ||
| #define TRC_SHADOW_RESYNC_ONLY (TRC_SHADOW + 15) | ||
|
|
||
| /* trace events per subclass */ | ||
| #define TRC_HVM_NESTEDFLAG (0x400) | ||
| #define TRC_HVM_VMENTRY (TRC_HVM_ENTRYEXIT + 0x01) | ||
| #define TRC_HVM_VMEXIT (TRC_HVM_ENTRYEXIT + 0x02) | ||
| #define TRC_HVM_VMEXIT64 (TRC_HVM_ENTRYEXIT + TRC_64_FLAG + 0x02) | ||
| #define TRC_HVM_PF_XEN (TRC_HVM_HANDLER + 0x01) | ||
| #define TRC_HVM_PF_XEN64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x01) | ||
| #define TRC_HVM_PF_INJECT (TRC_HVM_HANDLER + 0x02) | ||
| #define TRC_HVM_PF_INJECT64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x02) | ||
| #define TRC_HVM_INJ_EXC (TRC_HVM_HANDLER + 0x03) | ||
| #define TRC_HVM_INJ_VIRQ (TRC_HVM_HANDLER + 0x04) | ||
| #define TRC_HVM_REINJ_VIRQ (TRC_HVM_HANDLER + 0x05) | ||
| #define TRC_HVM_IO_READ (TRC_HVM_HANDLER + 0x06) | ||
| #define TRC_HVM_IO_WRITE (TRC_HVM_HANDLER + 0x07) | ||
| #define TRC_HVM_CR_READ (TRC_HVM_HANDLER + 0x08) | ||
| #define TRC_HVM_CR_READ64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x08) | ||
| #define TRC_HVM_CR_WRITE (TRC_HVM_HANDLER + 0x09) | ||
| #define TRC_HVM_CR_WRITE64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x09) | ||
| #define TRC_HVM_DR_READ (TRC_HVM_HANDLER + 0x0A) | ||
| #define TRC_HVM_DR_WRITE (TRC_HVM_HANDLER + 0x0B) | ||
| #define TRC_HVM_MSR_READ (TRC_HVM_HANDLER + 0x0C) | ||
| #define TRC_HVM_MSR_WRITE (TRC_HVM_HANDLER + 0x0D) | ||
| #define TRC_HVM_CPUID (TRC_HVM_HANDLER + 0x0E) | ||
| #define TRC_HVM_INTR (TRC_HVM_HANDLER + 0x0F) | ||
| #define TRC_HVM_NMI (TRC_HVM_HANDLER + 0x10) | ||
| #define TRC_HVM_SMI (TRC_HVM_HANDLER + 0x11) | ||
| #define TRC_HVM_VMMCALL (TRC_HVM_HANDLER + 0x12) | ||
| #define TRC_HVM_HLT (TRC_HVM_HANDLER + 0x13) | ||
| #define TRC_HVM_INVLPG (TRC_HVM_HANDLER + 0x14) | ||
| #define TRC_HVM_INVLPG64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x14) | ||
| #define TRC_HVM_MCE (TRC_HVM_HANDLER + 0x15) | ||
| #define TRC_HVM_IOPORT_READ (TRC_HVM_HANDLER + 0x16) | ||
| #define TRC_HVM_IOMEM_READ (TRC_HVM_HANDLER + 0x17) | ||
| #define TRC_HVM_CLTS (TRC_HVM_HANDLER + 0x18) | ||
| #define TRC_HVM_LMSW (TRC_HVM_HANDLER + 0x19) | ||
| #define TRC_HVM_LMSW64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19) | ||
| #define TRC_HVM_RDTSC (TRC_HVM_HANDLER + 0x1a) | ||
| #define TRC_HVM_INTR_WINDOW (TRC_HVM_HANDLER + 0x20) | ||
| #define TRC_HVM_NPF (TRC_HVM_HANDLER + 0x21) | ||
| #define TRC_HVM_REALMODE_EMULATE (TRC_HVM_HANDLER + 0x22) | ||
| #define TRC_HVM_TRAP (TRC_HVM_HANDLER + 0x23) | ||
| #define TRC_HVM_TRAP_DEBUG (TRC_HVM_HANDLER + 0x24) | ||
| #define TRC_HVM_VLAPIC (TRC_HVM_HANDLER + 0x25) | ||
| #define TRC_HVM_XCR_READ64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x26) | ||
| #define TRC_HVM_XCR_WRITE64 (TRC_HVM_HANDLER + TRC_64_FLAG + 0x27) | ||
|
|
||
| #define TRC_HVM_IOPORT_WRITE (TRC_HVM_HANDLER + 0x216) | ||
| #define TRC_HVM_IOMEM_WRITE (TRC_HVM_HANDLER + 0x217) | ||
|
|
||
| /* Trace events for emulated devices */ | ||
| #define TRC_HVM_EMUL_HPET_START_TIMER (TRC_HVM_EMUL + 0x1) | ||
| #define TRC_HVM_EMUL_PIT_START_TIMER (TRC_HVM_EMUL + 0x2) | ||
| #define TRC_HVM_EMUL_RTC_START_TIMER (TRC_HVM_EMUL + 0x3) | ||
| #define TRC_HVM_EMUL_LAPIC_START_TIMER (TRC_HVM_EMUL + 0x4) | ||
| #define TRC_HVM_EMUL_HPET_STOP_TIMER (TRC_HVM_EMUL + 0x5) | ||
| #define TRC_HVM_EMUL_PIT_STOP_TIMER (TRC_HVM_EMUL + 0x6) | ||
| #define TRC_HVM_EMUL_RTC_STOP_TIMER (TRC_HVM_EMUL + 0x7) | ||
| #define TRC_HVM_EMUL_LAPIC_STOP_TIMER (TRC_HVM_EMUL + 0x8) | ||
| #define TRC_HVM_EMUL_PIT_TIMER_CB (TRC_HVM_EMUL + 0x9) | ||
| #define TRC_HVM_EMUL_LAPIC_TIMER_CB (TRC_HVM_EMUL + 0xA) | ||
| #define TRC_HVM_EMUL_PIC_INT_OUTPUT (TRC_HVM_EMUL + 0xB) | ||
| #define TRC_HVM_EMUL_PIC_KICK (TRC_HVM_EMUL + 0xC) | ||
| #define TRC_HVM_EMUL_PIC_INTACK (TRC_HVM_EMUL + 0xD) | ||
| #define TRC_HVM_EMUL_PIC_POSEDGE (TRC_HVM_EMUL + 0xE) | ||
| #define TRC_HVM_EMUL_PIC_NEGEDGE (TRC_HVM_EMUL + 0xF) | ||
| #define TRC_HVM_EMUL_PIC_PEND_IRQ_CALL (TRC_HVM_EMUL + 0x10) | ||
| #define TRC_HVM_EMUL_LAPIC_PIC_INTR (TRC_HVM_EMUL + 0x11) | ||
|
|
||
| /* trace events for per class */ | ||
| #define TRC_PM_FREQ_CHANGE (TRC_HW_PM + 0x01) | ||
| #define TRC_PM_IDLE_ENTRY (TRC_HW_PM + 0x02) | ||
| #define TRC_PM_IDLE_EXIT (TRC_HW_PM + 0x03) | ||
|
|
||
| /* Trace events for IRQs */ | ||
| #define TRC_HW_IRQ_MOVE_CLEANUP_DELAY (TRC_HW_IRQ + 0x1) | ||
| #define TRC_HW_IRQ_MOVE_CLEANUP (TRC_HW_IRQ + 0x2) | ||
| #define TRC_HW_IRQ_BIND_VECTOR (TRC_HW_IRQ + 0x3) | ||
| #define TRC_HW_IRQ_CLEAR_VECTOR (TRC_HW_IRQ + 0x4) | ||
| #define TRC_HW_IRQ_MOVE_FINISH (TRC_HW_IRQ + 0x5) | ||
| #define TRC_HW_IRQ_ASSIGN_VECTOR (TRC_HW_IRQ + 0x6) | ||
| #define TRC_HW_IRQ_UNMAPPED_VECTOR (TRC_HW_IRQ + 0x7) | ||
| #define TRC_HW_IRQ_HANDLED (TRC_HW_IRQ + 0x8) | ||
|
|
||
| /* | ||
| * Event Flags | ||
| * | ||
| * Some events (e.g, TRC_PV_TRAP and TRC_HVM_IOMEM_READ) have multiple | ||
| * record formats. These event flags distinguish between the | ||
| * different formats. | ||
| */ | ||
| #define TRC_64_FLAG 0x100 /* Addresses are 64 bits (instead of 32 bits) */ | ||
|
|
||
| /* This structure represents a single trace buffer record. */ | ||
| struct t_rec { | ||
| uint32_t event:28; | ||
| uint32_t extra_u32:3; /* # entries in trailing extra_u32[] array */ | ||
| uint32_t cycles_included:1; /* u.cycles or u.no_cycles? */ | ||
| union { | ||
| struct { | ||
| uint32_t cycles_lo, cycles_hi; /* cycle counter timestamp */ | ||
| uint32_t extra_u32[7]; /* event data items */ | ||
| } cycles; | ||
| struct { | ||
| uint32_t extra_u32[7]; /* event data items */ | ||
| } nocycles; | ||
| } u; | ||
| }; | ||
|
|
||
| /* | ||
| * This structure contains the metadata for a single trace buffer. The head | ||
| * field, indexes into an array of struct t_rec's. | ||
| */ | ||
| struct t_buf { | ||
| /* Assume the data buffer size is X. X is generally not a power of 2. | ||
| * CONS and PROD are incremented modulo (2*X): | ||
| * 0 <= cons < 2*X | ||
| * 0 <= prod < 2*X | ||
| * This is done because addition modulo X breaks at 2^32 when X is not a | ||
| * power of 2: | ||
| * (((2^32 - 1) % X) + 1) % X != (2^32) % X | ||
| */ | ||
| uint32_t cons; /* Offset of next item to be consumed by control tools. */ | ||
| uint32_t prod; /* Offset of next item to be produced by Xen. */ | ||
| /* Records follow immediately after the meta-data header. */ | ||
| }; | ||
|
|
||
| /* Structure used to pass MFNs to the trace buffers back to trace consumers. | ||
| * Offset is an offset into the mapped structure where the mfn list will be held. | ||
| * MFNs will be at ((unsigned long *)(t_info))+(t_info->cpu_offset[cpu]). | ||
| */ | ||
| struct t_info { | ||
| uint16_t tbuf_size; /* Size in pages of each trace buffer */ | ||
| uint16_t mfn_offset[]; /* Offset within t_info structure of the page list per cpu */ | ||
| /* MFN lists immediately after the header */ | ||
| }; | ||
|
|
||
| #endif /* __XEN_PUBLIC_TRACE_H__ */ | ||
|
|
||
| /* | ||
| * Local variables: | ||
| * mode: C | ||
| * c-file-style: "BSD" | ||
| * c-basic-offset: 4 | ||
| * tab-width: 4 | ||
| * indent-tabs-mode: nil | ||
| * End: | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,248 @@ | ||
| /****************************************************************************** | ||
| * vcpu.h | ||
| * | ||
| * VCPU initialisation, query, and hotplug. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to | ||
| * deal in the Software without restriction, including without limitation the | ||
| * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| * sell copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| * DEALINGS IN THE SOFTWARE. | ||
| * | ||
| * Copyright (c) 2005, Keir Fraser <keir@xensource.com> | ||
| */ | ||
|
|
||
| #ifndef __XEN_PUBLIC_VCPU_H__ | ||
| #define __XEN_PUBLIC_VCPU_H__ | ||
|
|
||
| #include "xen.h" | ||
|
|
||
| /* | ||
| * Prototype for this hypercall is: | ||
| * long vcpu_op(int cmd, unsigned int vcpuid, void *extra_args) | ||
| * @cmd == VCPUOP_??? (VCPU operation). | ||
| * @vcpuid == VCPU to operate on. | ||
| * @extra_args == Operation-specific extra arguments (NULL if none). | ||
| */ | ||
|
|
||
| /* | ||
| * Initialise a VCPU. Each VCPU can be initialised only once. A | ||
| * newly-initialised VCPU will not run until it is brought up by VCPUOP_up. | ||
| * | ||
| * @extra_arg == For PV or ARM guests this is a pointer to a vcpu_guest_context | ||
| * structure containing the initial state for the VCPU. For x86 | ||
| * HVM based guests this is a pointer to a vcpu_hvm_context | ||
| * structure. | ||
| */ | ||
| #define VCPUOP_initialise 0 | ||
|
|
||
| /* | ||
| * Bring up a VCPU. This makes the VCPU runnable. This operation will fail | ||
| * if the VCPU has not been initialised (VCPUOP_initialise). | ||
| */ | ||
| #define VCPUOP_up 1 | ||
|
|
||
| /* | ||
| * Bring down a VCPU (i.e., make it non-runnable). | ||
| * There are a few caveats that callers should observe: | ||
| * 1. This operation may return, and VCPU_is_up may return false, before the | ||
| * VCPU stops running (i.e., the command is asynchronous). It is a good | ||
| * idea to ensure that the VCPU has entered a non-critical loop before | ||
| * bringing it down. Alternatively, this operation is guaranteed | ||
| * synchronous if invoked by the VCPU itself. | ||
| * 2. After a VCPU is initialised, there is currently no way to drop all its | ||
| * references to domain memory. Even a VCPU that is down still holds | ||
| * memory references via its pagetable base pointer and GDT. It is good | ||
| * practise to move a VCPU onto an 'idle' or default page table, LDT and | ||
| * GDT before bringing it down. | ||
| */ | ||
| #define VCPUOP_down 2 | ||
|
|
||
| /* Returns 1 if the given VCPU is up. */ | ||
| #define VCPUOP_is_up 3 | ||
|
|
||
| /* | ||
| * Return information about the state and running time of a VCPU. | ||
| * @extra_arg == pointer to vcpu_runstate_info structure. | ||
| */ | ||
| #define VCPUOP_get_runstate_info 4 | ||
| struct vcpu_runstate_info { | ||
| /* VCPU's current state (RUNSTATE_*). */ | ||
| int state; | ||
| /* When was current state entered (system time, ns)? */ | ||
| uint64_t state_entry_time; | ||
| /* | ||
| * Update indicator set in state_entry_time: | ||
| * When activated via VMASST_TYPE_runstate_update_flag, set during | ||
| * updates in guest memory mapped copy of vcpu_runstate_info. | ||
| */ | ||
| #define XEN_RUNSTATE_UPDATE (xen_mk_ullong(1) << 63) | ||
| /* | ||
| * Time spent in each RUNSTATE_* (ns). The sum of these times is | ||
| * guaranteed not to drift from system time. | ||
| */ | ||
| uint64_t time[4]; | ||
| }; | ||
| typedef struct vcpu_runstate_info vcpu_runstate_info_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_t); | ||
|
|
||
| /* VCPU is currently running on a physical CPU. */ | ||
| #define RUNSTATE_running 0 | ||
|
|
||
| /* VCPU is runnable, but not currently scheduled on any physical CPU. */ | ||
| #define RUNSTATE_runnable 1 | ||
|
|
||
| /* VCPU is blocked (a.k.a. idle). It is therefore not runnable. */ | ||
| #define RUNSTATE_blocked 2 | ||
|
|
||
| /* | ||
| * VCPU is not runnable, but it is not blocked. | ||
| * This is a 'catch all' state for things like hotplug and pauses by the | ||
| * system administrator (or for critical sections in the hypervisor). | ||
| * RUNSTATE_blocked dominates this state (it is the preferred state). | ||
| */ | ||
| #define RUNSTATE_offline 3 | ||
|
|
||
| /* | ||
| * Register a shared memory area from which the guest may obtain its own | ||
| * runstate information without needing to execute a hypercall. | ||
| * Notes: | ||
| * 1. The registered address may be virtual or physical or guest handle, | ||
| * depending on the platform. Virtual address or guest handle should be | ||
| * registered on x86 systems. | ||
| * 2. Only one shared area may be registered per VCPU. The shared area is | ||
| * updated by the hypervisor each time the VCPU is scheduled. Thus | ||
| * runstate.state will always be RUNSTATE_running and | ||
| * runstate.state_entry_time will indicate the system time at which the | ||
| * VCPU was last scheduled to run. | ||
| * @extra_arg == pointer to vcpu_register_runstate_memory_area structure. | ||
| */ | ||
| #define VCPUOP_register_runstate_memory_area 5 | ||
| struct vcpu_register_runstate_memory_area { | ||
| union { | ||
| XEN_GUEST_HANDLE(vcpu_runstate_info_t) h; | ||
| struct vcpu_runstate_info *v; | ||
| uint64_t p; | ||
| } addr; | ||
| }; | ||
| typedef struct vcpu_register_runstate_memory_area vcpu_register_runstate_memory_area_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_register_runstate_memory_area_t); | ||
|
|
||
| /* | ||
| * Set or stop a VCPU's periodic timer. Every VCPU has one periodic timer | ||
| * which can be set via these commands. Periods smaller than one millisecond | ||
| * may not be supported. | ||
| */ | ||
| #define VCPUOP_set_periodic_timer 6 /* arg == vcpu_set_periodic_timer_t */ | ||
| #define VCPUOP_stop_periodic_timer 7 /* arg == NULL */ | ||
| struct vcpu_set_periodic_timer { | ||
| uint64_t period_ns; | ||
| }; | ||
| typedef struct vcpu_set_periodic_timer vcpu_set_periodic_timer_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_set_periodic_timer_t); | ||
|
|
||
| /* | ||
| * Set or stop a VCPU's single-shot timer. Every VCPU has one single-shot | ||
| * timer which can be set via these commands. | ||
| */ | ||
| #define VCPUOP_set_singleshot_timer 8 /* arg == vcpu_set_singleshot_timer_t */ | ||
| #define VCPUOP_stop_singleshot_timer 9 /* arg == NULL */ | ||
| struct vcpu_set_singleshot_timer { | ||
| uint64_t timeout_abs_ns; /* Absolute system time value in nanoseconds. */ | ||
| uint32_t flags; /* VCPU_SSHOTTMR_??? */ | ||
| }; | ||
| typedef struct vcpu_set_singleshot_timer vcpu_set_singleshot_timer_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_set_singleshot_timer_t); | ||
|
|
||
| /* Flags to VCPUOP_set_singleshot_timer. */ | ||
| /* Require the timeout to be in the future (return -ETIME if it's passed). */ | ||
| #define _VCPU_SSHOTTMR_future (0) | ||
| #define VCPU_SSHOTTMR_future (1U << _VCPU_SSHOTTMR_future) | ||
|
|
||
| /* | ||
| * Register a memory location in the guest address space for the | ||
| * vcpu_info structure. This allows the guest to place the vcpu_info | ||
| * structure in a convenient place, such as in a per-cpu data area. | ||
| * The pointer need not be page aligned, but the structure must not | ||
| * cross a page boundary. | ||
| * | ||
| * This may be called only once per vcpu. | ||
| */ | ||
| #define VCPUOP_register_vcpu_info 10 /* arg == vcpu_register_vcpu_info_t */ | ||
| struct vcpu_register_vcpu_info { | ||
| uint64_t mfn; /* mfn of page to place vcpu_info */ | ||
| uint32_t offset; /* offset within page */ | ||
| uint32_t rsvd; /* unused */ | ||
| }; | ||
| typedef struct vcpu_register_vcpu_info vcpu_register_vcpu_info_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_register_vcpu_info_t); | ||
|
|
||
| /* Send an NMI to the specified VCPU. @extra_arg == NULL. */ | ||
| #define VCPUOP_send_nmi 11 | ||
|
|
||
| /* | ||
| * Get the physical ID information for a pinned vcpu's underlying physical | ||
| * processor. The physical ID informmation is architecture-specific. | ||
| * On x86: id[31:0]=apic_id, id[63:32]=acpi_id. | ||
| * This command returns -EINVAL if it is not a valid operation for this VCPU. | ||
| */ | ||
| #define VCPUOP_get_physid 12 /* arg == vcpu_get_physid_t */ | ||
| struct vcpu_get_physid { | ||
| uint64_t phys_id; | ||
| }; | ||
| typedef struct vcpu_get_physid vcpu_get_physid_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_get_physid_t); | ||
| #define xen_vcpu_physid_to_x86_apicid(physid) ((uint32_t)(physid)) | ||
| #define xen_vcpu_physid_to_x86_acpiid(physid) ((uint32_t)((physid) >> 32)) | ||
|
|
||
| /* | ||
| * Register a memory location to get a secondary copy of the vcpu time | ||
| * parameters. The master copy still exists as part of the vcpu shared | ||
| * memory area, and this secondary copy is updated whenever the master copy | ||
| * is updated (and using the same versioning scheme for synchronisation). | ||
| * | ||
| * The intent is that this copy may be mapped (RO) into userspace so | ||
| * that usermode can compute system time using the time info and the | ||
| * tsc. Usermode will see an array of vcpu_time_info structures, one | ||
| * for each vcpu, and choose the right one by an existing mechanism | ||
| * which allows it to get the current vcpu number (such as via a | ||
| * segment limit). It can then apply the normal algorithm to compute | ||
| * system time from the tsc. | ||
| * | ||
| * @extra_arg == pointer to vcpu_register_time_info_memory_area structure. | ||
| */ | ||
| #define VCPUOP_register_vcpu_time_memory_area 13 | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_time_info_t); | ||
| struct vcpu_register_time_memory_area { | ||
| union { | ||
| XEN_GUEST_HANDLE(vcpu_time_info_t) h; | ||
| struct vcpu_time_info *v; | ||
| uint64_t p; | ||
| } addr; | ||
| }; | ||
| typedef struct vcpu_register_time_memory_area vcpu_register_time_memory_area_t; | ||
| DEFINE_XEN_GUEST_HANDLE(vcpu_register_time_memory_area_t); | ||
|
|
||
| #endif /* __XEN_PUBLIC_VCPU_H__ */ | ||
|
|
||
| /* | ||
| * Local variables: | ||
| * mode: C | ||
| * c-file-style: "BSD" | ||
| * c-basic-offset: 4 | ||
| * tab-width: 4 | ||
| * indent-tabs-mode: nil | ||
| * End: | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| /****************************************************************************** | ||
| * version.h | ||
| * | ||
| * Xen version, type, and compile information. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to | ||
| * deal in the Software without restriction, including without limitation the | ||
| * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| * sell copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| * DEALINGS IN THE SOFTWARE. | ||
| * | ||
| * Copyright (c) 2005, Nguyen Anh Quynh <aquynh@gmail.com> | ||
| * Copyright (c) 2005, Keir Fraser <keir@xensource.com> | ||
| */ | ||
|
|
||
| #ifndef __XEN_PUBLIC_VERSION_H__ | ||
| #define __XEN_PUBLIC_VERSION_H__ | ||
|
|
||
| #include "xen.h" | ||
|
|
||
| /* NB. All ops return zero on success, except XENVER_{version,pagesize} | ||
| * XENVER_{version,pagesize,build_id} */ | ||
|
|
||
| /* arg == NULL; returns major:minor (16:16). */ | ||
| #define XENVER_version 0 | ||
|
|
||
| /* arg == xen_extraversion_t. */ | ||
| #define XENVER_extraversion 1 | ||
| typedef char xen_extraversion_t[16]; | ||
| #define XEN_EXTRAVERSION_LEN (sizeof(xen_extraversion_t)) | ||
|
|
||
| /* arg == xen_compile_info_t. */ | ||
| #define XENVER_compile_info 2 | ||
| struct xen_compile_info { | ||
| char compiler[64]; | ||
| char compile_by[16]; | ||
| char compile_domain[32]; | ||
| char compile_date[32]; | ||
| }; | ||
| typedef struct xen_compile_info xen_compile_info_t; | ||
|
|
||
| #define XENVER_capabilities 3 | ||
| typedef char xen_capabilities_info_t[1024]; | ||
| #define XEN_CAPABILITIES_INFO_LEN (sizeof(xen_capabilities_info_t)) | ||
|
|
||
| #define XENVER_changeset 4 | ||
| typedef char xen_changeset_info_t[64]; | ||
| #define XEN_CHANGESET_INFO_LEN (sizeof(xen_changeset_info_t)) | ||
|
|
||
| #define XENVER_platform_parameters 5 | ||
| struct xen_platform_parameters { | ||
| xen_ulong_t virt_start; | ||
| }; | ||
| typedef struct xen_platform_parameters xen_platform_parameters_t; | ||
|
|
||
| #define XENVER_get_features 6 | ||
| struct xen_feature_info { | ||
| unsigned int submap_idx; /* IN: which 32-bit submap to return */ | ||
| uint32_t submap; /* OUT: 32-bit submap */ | ||
| }; | ||
| typedef struct xen_feature_info xen_feature_info_t; | ||
|
|
||
| /* Declares the features reported by XENVER_get_features. */ | ||
| #include "features.h" | ||
|
|
||
| /* arg == NULL; returns host memory page size. */ | ||
| #define XENVER_pagesize 7 | ||
|
|
||
| /* arg == xen_domain_handle_t. | ||
| * | ||
| * The toolstack fills it out for guest consumption. It is intended to hold | ||
| * the UUID of the guest. | ||
| */ | ||
| #define XENVER_guest_handle 8 | ||
|
|
||
| #define XENVER_commandline 9 | ||
| typedef char xen_commandline_t[1024]; | ||
|
|
||
| /* | ||
| * Return value is the number of bytes written, or XEN_Exx on error. | ||
| * Calling with empty parameter returns the size of build_id. | ||
| */ | ||
| #define XENVER_build_id 10 | ||
| struct xen_build_id { | ||
| uint32_t len; /* IN: size of buf[]. */ | ||
| unsigned char buf[XEN_FLEX_ARRAY_DIM]; | ||
| /* OUT: Variable length buffer with build_id. */ | ||
| }; | ||
| typedef struct xen_build_id xen_build_id_t; | ||
|
|
||
| #endif /* __XEN_PUBLIC_VERSION_H__ */ | ||
|
|
||
| /* | ||
| * Local variables: | ||
| * mode: C | ||
| * c-file-style: "BSD" | ||
| * c-basic-offset: 4 | ||
| * tab-width: 4 | ||
| * indent-tabs-mode: nil | ||
| * End: | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /****************************************************************************** | ||
| * xen-compat.h | ||
| * | ||
| * Guest OS interface to Xen. Compatibility layer. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to | ||
| * deal in the Software without restriction, including without limitation the | ||
| * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| * sell copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| * DEALINGS IN THE SOFTWARE. | ||
| * | ||
| * Copyright (c) 2006, Christian Limpach | ||
| */ | ||
|
|
||
| #ifndef __XEN_PUBLIC_XEN_COMPAT_H__ | ||
| #define __XEN_PUBLIC_XEN_COMPAT_H__ | ||
|
|
||
| #define __XEN_LATEST_INTERFACE_VERSION__ 0x00040e00 | ||
|
|
||
| #if defined(__XEN__) || defined(__XEN_TOOLS__) | ||
| /* Xen is built with matching headers and implements the latest interface. */ | ||
| #define __XEN_INTERFACE_VERSION__ __XEN_LATEST_INTERFACE_VERSION__ | ||
| #elif !defined(__XEN_INTERFACE_VERSION__) | ||
| /* Guests which do not specify a version get the legacy interface. */ | ||
| #define __XEN_INTERFACE_VERSION__ 0x00000000 | ||
| #endif | ||
|
|
||
| #if __XEN_INTERFACE_VERSION__ > __XEN_LATEST_INTERFACE_VERSION__ | ||
| #error "These header files do not support the requested interface version." | ||
| #endif | ||
|
|
||
| #define COMPAT_FLEX_ARRAY_DIM XEN_FLEX_ARRAY_DIM | ||
|
|
||
| #endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */ |