Xen Test Framework
include
xen
hvm
hvm_vcpu.h
Go to the documentation of this file.
1
/*
2
* Xen public HVM VCPU hypercall interface
3
*/
4
#ifndef XEN_PUBLIC_HVM_HVM_VCPU_H
5
#define XEN_PUBLIC_HVM_HVM_VCPU_H
6
7
#include "../xen.h"
8
9
struct
xen_vcpu_hvm_x86_32
{
10
uint32_t
eax
;
11
uint32_t
ecx
;
12
uint32_t
edx
;
13
uint32_t
ebx
;
14
uint32_t
esp
;
15
uint32_t
ebp
;
16
uint32_t
esi
;
17
uint32_t
edi
;
18
uint32_t
eip
;
19
uint32_t
eflags
;
20
21
uint32_t
cr0
;
22
uint32_t
cr3
;
23
uint32_t
cr4
;
24
25
uint32_t
pad1
;
26
27
/*
28
* EFER should only be used to set the NXE bit (if required)
29
* when starting a vCPU in 32bit mode with paging enabled or
30
* to set the LME/LMA bits in order to start the vCPU in
31
* compatibility mode.
32
*/
33
uint64_t
efer
;
34
35
uint32_t
cs_base
;
36
uint32_t
ds_base
;
37
uint32_t
ss_base
;
38
uint32_t
es_base
;
39
uint32_t
tr_base
;
40
uint32_t
cs_limit
;
41
uint32_t
ds_limit
;
42
uint32_t
ss_limit
;
43
uint32_t
es_limit
;
44
uint32_t
tr_limit
;
45
uint16_t
cs_ar
;
46
uint16_t
ds_ar
;
47
uint16_t
ss_ar
;
48
uint16_t
es_ar
;
49
uint16_t
tr_ar
;
50
51
uint16_t
pad2
[3];
52
};
53
54
/*
55
* The layout of the _ar fields of the segment registers is the
56
* following:
57
*
58
* Bits [0,3]: type (bits 40-43).
59
* Bit 4: s (descriptor type, bit 44).
60
* Bit [5,6]: dpl (descriptor privilege level, bits 45-46).
61
* Bit 7: p (segment-present, bit 47).
62
* Bit 8: avl (available for system software, bit 52).
63
* Bit 9: l (64-bit code segment, bit 53).
64
* Bit 10: db (meaning depends on the segment, bit 54).
65
* Bit 11: g (granularity, bit 55)
66
* Bits [12,15]: unused, must be blank.
67
*
68
* A more complete description of the meaning of this fields can be
69
* obtained from the Intel SDM, Volume 3, section 3.4.5.
70
*/
71
72
struct
xen_vcpu_hvm_x86_64
{
73
uint64_t
rax
;
74
uint64_t
rcx
;
75
uint64_t
rdx
;
76
uint64_t
rbx
;
77
uint64_t
rsp
;
78
uint64_t
rbp
;
79
uint64_t
rsi
;
80
uint64_t
rdi
;
81
uint64_t
rip
;
82
uint64_t
rflags
;
83
84
uint64_t
cr0
;
85
uint64_t
cr3
;
86
uint64_t
cr4
;
87
uint64_t
efer
;
88
89
/*
90
* Using VCPU_HVM_MODE_64B implies that the vCPU is launched
91
* directly in long mode, so the cached parts of the segment
92
* registers get set to match that environment.
93
*
94
* If the user wants to launch the vCPU in compatibility mode
95
* the 32-bit structure should be used instead.
96
*/
97
};
98
99
struct
xen_vcpu_hvm_context
{
100
#define VCPU_HVM_MODE_32B 0
/* 32bit fields of the structure will be used. */
101
#define VCPU_HVM_MODE_64B 1
/* 64bit fields of the structure will be used. */
102
uint32_t
mode
;
103
104
uint32_t
pad
;
105
106
/* CPU registers. */
107
union
{
108
struct
xen_vcpu_hvm_x86_32
x86_32
;
109
struct
xen_vcpu_hvm_x86_64
x86_64
;
110
}
cpu_regs
;
111
};
112
113
#endif
/* XEN_PUBLIC_HVM_HVM_VCPU_H */
114
115
/*
116
* Local variables:
117
* mode: C
118
* c-file-style: "BSD"
119
* c-basic-offset: 4
120
* tab-width: 4
121
* indent-tabs-mode: nil
122
* End:
123
*/
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:16
uint64_t
__UINT64_TYPE__ uint64_t
Definition:
stdint.h:17
uint16_t
__UINT16_TYPE__ uint16_t
Definition:
stdint.h:15
xen_vcpu_hvm_context
Definition:
hvm_vcpu.h:99
xen_vcpu_hvm_context::cpu_regs
union xen_vcpu_hvm_context::@41 cpu_regs
xen_vcpu_hvm_context::mode
uint32_t mode
Definition:
hvm_vcpu.h:102
xen_vcpu_hvm_context::x86_64
struct xen_vcpu_hvm_x86_64 x86_64
Definition:
hvm_vcpu.h:109
xen_vcpu_hvm_context::x86_32
struct xen_vcpu_hvm_x86_32 x86_32
Definition:
hvm_vcpu.h:108
xen_vcpu_hvm_context::pad
uint32_t pad
Definition:
hvm_vcpu.h:104
xen_vcpu_hvm_x86_32
Definition:
hvm_vcpu.h:9
xen_vcpu_hvm_x86_32::cs_base
uint32_t cs_base
Definition:
hvm_vcpu.h:35
xen_vcpu_hvm_x86_32::ds_ar
uint16_t ds_ar
Definition:
hvm_vcpu.h:46
xen_vcpu_hvm_x86_32::eip
uint32_t eip
Definition:
hvm_vcpu.h:18
xen_vcpu_hvm_x86_32::ds_limit
uint32_t ds_limit
Definition:
hvm_vcpu.h:41
xen_vcpu_hvm_x86_32::cr0
uint32_t cr0
Definition:
hvm_vcpu.h:21
xen_vcpu_hvm_x86_32::edi
uint32_t edi
Definition:
hvm_vcpu.h:17
xen_vcpu_hvm_x86_32::cr4
uint32_t cr4
Definition:
hvm_vcpu.h:23
xen_vcpu_hvm_x86_32::ss_base
uint32_t ss_base
Definition:
hvm_vcpu.h:37
xen_vcpu_hvm_x86_32::es_ar
uint16_t es_ar
Definition:
hvm_vcpu.h:48
xen_vcpu_hvm_x86_32::pad2
uint16_t pad2[3]
Definition:
hvm_vcpu.h:51
xen_vcpu_hvm_x86_32::tr_base
uint32_t tr_base
Definition:
hvm_vcpu.h:39
xen_vcpu_hvm_x86_32::esp
uint32_t esp
Definition:
hvm_vcpu.h:14
xen_vcpu_hvm_x86_32::efer
uint64_t efer
Definition:
hvm_vcpu.h:33
xen_vcpu_hvm_x86_32::eax
uint32_t eax
Definition:
hvm_vcpu.h:10
xen_vcpu_hvm_x86_32::tr_ar
uint16_t tr_ar
Definition:
hvm_vcpu.h:49
xen_vcpu_hvm_x86_32::ds_base
uint32_t ds_base
Definition:
hvm_vcpu.h:36
xen_vcpu_hvm_x86_32::cr3
uint32_t cr3
Definition:
hvm_vcpu.h:22
xen_vcpu_hvm_x86_32::cs_ar
uint16_t cs_ar
Definition:
hvm_vcpu.h:45
xen_vcpu_hvm_x86_32::es_base
uint32_t es_base
Definition:
hvm_vcpu.h:38
xen_vcpu_hvm_x86_32::ebp
uint32_t ebp
Definition:
hvm_vcpu.h:15
xen_vcpu_hvm_x86_32::ss_limit
uint32_t ss_limit
Definition:
hvm_vcpu.h:42
xen_vcpu_hvm_x86_32::pad1
uint32_t pad1
Definition:
hvm_vcpu.h:25
xen_vcpu_hvm_x86_32::esi
uint32_t esi
Definition:
hvm_vcpu.h:16
xen_vcpu_hvm_x86_32::edx
uint32_t edx
Definition:
hvm_vcpu.h:12
xen_vcpu_hvm_x86_32::ebx
uint32_t ebx
Definition:
hvm_vcpu.h:13
xen_vcpu_hvm_x86_32::tr_limit
uint32_t tr_limit
Definition:
hvm_vcpu.h:44
xen_vcpu_hvm_x86_32::eflags
uint32_t eflags
Definition:
hvm_vcpu.h:19
xen_vcpu_hvm_x86_32::ecx
uint32_t ecx
Definition:
hvm_vcpu.h:11
xen_vcpu_hvm_x86_32::cs_limit
uint32_t cs_limit
Definition:
hvm_vcpu.h:40
xen_vcpu_hvm_x86_32::es_limit
uint32_t es_limit
Definition:
hvm_vcpu.h:43
xen_vcpu_hvm_x86_32::ss_ar
uint16_t ss_ar
Definition:
hvm_vcpu.h:47
xen_vcpu_hvm_x86_64
Definition:
hvm_vcpu.h:72
xen_vcpu_hvm_x86_64::cr3
uint64_t cr3
Definition:
hvm_vcpu.h:85
xen_vcpu_hvm_x86_64::rbx
uint64_t rbx
Definition:
hvm_vcpu.h:76
xen_vcpu_hvm_x86_64::rdi
uint64_t rdi
Definition:
hvm_vcpu.h:80
xen_vcpu_hvm_x86_64::cr0
uint64_t cr0
Definition:
hvm_vcpu.h:84
xen_vcpu_hvm_x86_64::rdx
uint64_t rdx
Definition:
hvm_vcpu.h:75
xen_vcpu_hvm_x86_64::efer
uint64_t efer
Definition:
hvm_vcpu.h:87
xen_vcpu_hvm_x86_64::rsp
uint64_t rsp
Definition:
hvm_vcpu.h:77
xen_vcpu_hvm_x86_64::rip
uint64_t rip
Definition:
hvm_vcpu.h:81
xen_vcpu_hvm_x86_64::rcx
uint64_t rcx
Definition:
hvm_vcpu.h:74
xen_vcpu_hvm_x86_64::rbp
uint64_t rbp
Definition:
hvm_vcpu.h:78
xen_vcpu_hvm_x86_64::rflags
uint64_t rflags
Definition:
hvm_vcpu.h:82
xen_vcpu_hvm_x86_64::cr4
uint64_t cr4
Definition:
hvm_vcpu.h:86
xen_vcpu_hvm_x86_64::rsi
uint64_t rsi
Definition:
hvm_vcpu.h:79
xen_vcpu_hvm_x86_64::rax
uint64_t rax
Definition:
hvm_vcpu.h:73
Generated by
1.9.4