movl VMCB_rax(%ecx),%eax
movl %eax,UREGS_eax(%esp)
+#ifndef NDEBUG
+ movl $0xdeadbeef,%eax
+ movw %ax,UREGS_error_code(%esp)
+ movw %ax,UREGS_entry_vector(%esp)
+ movw %ax,UREGS_saved_upcall_mask(%esp)
+ movw %ax,UREGS_cs(%esp)
+ movw %ax,UREGS_ds(%esp)
+ movw %ax,UREGS_es(%esp)
+ movw %ax,UREGS_fs(%esp)
+ movw %ax,UREGS_gs(%esp)
+ movw %ax,UREGS_ss(%esp)
+ movl %eax,UREGS_eflags(%esp)
+ movl %eax,UREGS_eip(%esp)
+ movl %eax,UREGS_esp(%esp)
+#endif
+
STGI
.globl svm_stgi_label;
svm_stgi_label:
movq VMCB_rax(%rcx),%rax
movq %rax,UREGS_rax(%rsp)
+#ifndef NDEBUG
+ movl $0xdeadbeef,%eax
+ movw %ax,UREGS_error_code(%rsp)
+ movw %ax,UREGS_entry_vector(%rsp)
+ movw %ax,UREGS_saved_upcall_mask(%rsp)
+ movw %ax,UREGS_cs(%rsp)
+ movw %ax,UREGS_ds(%rsp)
+ movw %ax,UREGS_es(%rsp)
+ movw %ax,UREGS_fs(%rsp)
+ movw %ax,UREGS_gs(%rsp)
+ movw %ax,UREGS_ss(%rsp)
+ movq %rax,UREGS_eflags(%rsp)
+ movq %rax,UREGS_rip(%rsp)
+ movq %rax,UREGS_rsp(%rsp)
+#endif
+
STGI
.globl svm_stgi_label;
svm_stgi_label:
movl (reg),reg;
#define HVM_SAVE_ALL_NOSEGREGS \
- movl $0, 0xc(%esp); /* XXX why do we need to force eflags==0 ?? */ \
pushl %eax; \
pushl %ebp; \
pushl %edi; \
ALIGN
ENTRY(vmx_asm_vmexit_handler)
HVM_SAVE_ALL_NOSEGREGS
+
+#ifndef NDEBUG
+ movl $0xdeadbeef,%eax
+ movw %ax,UREGS_error_code(%esp)
+ movw %ax,UREGS_entry_vector(%esp)
+ movw %ax,UREGS_saved_upcall_mask(%esp)
+ movw %ax,UREGS_cs(%esp)
+ movw %ax,UREGS_ds(%esp)
+ movw %ax,UREGS_es(%esp)
+ movw %ax,UREGS_fs(%esp)
+ movw %ax,UREGS_gs(%esp)
+ movw %ax,UREGS_ss(%esp)
+ movl %eax,UREGS_eflags(%esp)
+ movl %eax,UREGS_eip(%esp)
+ movl %eax,UREGS_esp(%esp)
+#endif
+
movl %esp,%eax
push %eax
call vmx_vmexit_handler
ALIGN
ENTRY(vmx_asm_vmexit_handler)
HVM_SAVE_ALL_NOSEGREGS
+
+#ifndef NDEBUG
+ movl $0xdeadbeef,%eax
+ movw %ax,UREGS_error_code(%rsp)
+ movw %ax,UREGS_entry_vector(%rsp)
+ movw %ax,UREGS_saved_upcall_mask(%rsp)
+ movw %ax,UREGS_cs(%rsp)
+ movw %ax,UREGS_ds(%rsp)
+ movw %ax,UREGS_es(%rsp)
+ movw %ax,UREGS_fs(%rsp)
+ movw %ax,UREGS_gs(%rsp)
+ movw %ax,UREGS_ss(%rsp)
+ movq %rax,UREGS_eflags(%rsp)
+ movq %rax,UREGS_rip(%rsp)
+ movq %rax,UREGS_rsp(%rsp)
+#endif
+
movq %rsp,%rdi
call vmx_vmexit_handler
jmp vmx_asm_do_vmentry
OFFSET(UREGS_eflags, struct cpu_user_regs, eflags);
OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
+ OFFSET(UREGS_saved_upcall_mask, struct cpu_user_regs, saved_upcall_mask);
OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, esp);
DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
BLANK();
OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);
OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
+ OFFSET(UREGS_saved_upcall_mask, struct cpu_user_regs, saved_upcall_mask);
OFFSET(UREGS_rip, struct cpu_user_regs, rip);
OFFSET(UREGS_cs, struct cpu_user_regs, cs);
OFFSET(UREGS_eflags, struct cpu_user_regs, eflags);
OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
OFFSET(UREGS_ss, struct cpu_user_regs, ss);
+ OFFSET(UREGS_ds, struct cpu_user_regs, ds);
+ OFFSET(UREGS_es, struct cpu_user_regs, es);
+ OFFSET(UREGS_fs, struct cpu_user_regs, fs);
+ OFFSET(UREGS_gs, struct cpu_user_regs, gs);
OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);
DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
BLANK();