11 #define SVM_ERROR .dword 0xffffffff
12 #define SVM_SUCCESS .dword 0x00000000
14 #define vmrun .byte 0x0f,0x01,0xd8
15 #define vmload .byte 0x0F,0x01,0xDA
16 #define vmsave .byte 0x0F,0x01,0xDB
17 #define stgi .byte 0x0F,0x01,0xDC
18 #define clgi .byte 0x0F,0x01,0xDD
23 #define Save_SVM_Registers(location) \
25 movl location, %eax; \
28 movl %ebp, 16(%eax); \
30 movl %ebx, 32(%eax); \
31 movl %edx, 40(%eax); \
32 movl %ecx, 48(%eax); \
35 movl %ebx, 56(%eax); \
40 #define Restore_SVM_Registers(location) \
42 movl location, %eax; \
45 movl 16(%eax), %ebp; \
46 movl 32(%eax), %ebx; \
47 movl 40(%eax), %edx; \
48 movl 48(%eax), %ecx; \
63 Restore_SVM_Registers(8(%esp));
70 Save_SVM_Registers(4(%esp));
85 #define Save_SVM_Registers(location) \
87 movq location, %rax; \
90 movq %rbp, 16(%rax); \
92 movq %rbx, 32(%rax); \
93 movq %rdx, 40(%rax); \
94 movq %rcx, 48(%rax); \
96 movq 16(%rsp), %rbx; \
97 movq %rbx, 56(%rax); \
100 movq %r8, 64(%rax); \
101 movq %r9, 72(%rax); \
102 movq %r10, 80(%rax); \
103 movq %r11, 88(%rax); \
104 movq %r12, 96(%rax); \
105 movq %r13, 104(%rax); \
106 movq %r14, 112(%rax); \
107 movq %r15, 120(%rax); \
111 #define Restore_SVM_Registers(location) \
113 mov location, %rax; \
116 mov 16(%rax), %rbp; \
117 mov 32(%rax), %rbx; \
118 mov 40(%rax), %rdx; \
119 mov 48(%rax), %rcx; \
123 mov 80(%rax), %r10; \
124 mov 88(%rax), %r11; \
125 mov 96(%rax), %r12; \
126 mov 104(%rax), %r13; \
127 mov 112(%rax), %r14; \
128 mov 120(%rax), %r15; \
186 Restore_SVM_Registers(%rsi);
194 Save_SVM_Registers(8(%rsp));