svm: Simplify asm stub for vmentry/vmexit.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
Keir Fraser committed 2007-05-12 19:22:24 +01:00
1 parent f64b7618e1
commit 2c4aacf734
2 files changed
+25 -49

No files matched your search

+8 -20
View File
@@ -31,26 +31,13 @@
andl $~3,reg; \
movl (reg),reg;
#define HVM_MONITOR_EFLAGS 0x202 /* IF on */
#define NR_SKIPPED_REGS 7 /* Skip SS thru EAX */
#define HVM_SAVE_ALL_NOSEGREGS \
pushl $HVM_MONITOR_EFLAGS; \
popf; \
subl $(NR_SKIPPED_REGS*4),%esp; \
pushl %ebp; \
pushl %edi; \
pushl %esi; \
pushl %edx; \
pushl %ecx; \
pushl %ebx;
#define VMRUN .byte 0x0F,0x01,0xD8
#define STGI .byte 0x0F,0x01,0xDC
#define CLGI .byte 0x0F,0x01,0xDD
ENTRY(svm_asm_do_resume)
GET_CURRENT(%ebx)
cli # tests must not race interrupts
CLGI
movl VCPU_processor(%ebx),%eax
shl $IRQSTAT_shift,%eax
testl $~0,irq_stat(%eax,1)
@@ -58,9 +45,6 @@ ENTRY(svm_asm_do_resume)
call svm_intr_assist
call svm_load_cr2
CLGI
sti
GET_CURRENT(%ebx)
movl VCPU_svm_vmcb(%ebx),%ecx
movl UREGS_eax(%esp),%eax
movl %eax,VMCB_rax(%ecx)
@@ -72,11 +56,15 @@ ENTRY(svm_asm_do_resume)
popl %esi
popl %edi
popl %ebp
addl $(NR_SKIPPED_REGS*4),%esp
VMRUN
HVM_SAVE_ALL_NOSEGREGS
pushl %ebp
pushl %edi
pushl %esi
pushl %edx
pushl %ecx
pushl %ebx
GET_CURRENT(%ebx)
movb $0,VCPU_svm_vmcb_in_sync(%ebx)
@@ -95,6 +83,6 @@ svm_stgi_label:
ALIGN
svm_process_softirqs:
sti
STGI
call do_softirq
jmp svm_asm_do_resume
+17 -29
View File
@@ -31,35 +31,13 @@
andq $~7,reg; \
movq (reg),reg;
#define HVM_MONITOR_RFLAGS 0x202 /* IF on */
#define NR_SKIPPED_REGS 6 /* Skip SS thru error_code */
#define HVM_SAVE_ALL_NOSEGREGS \
pushq $HVM_MONITOR_RFLAGS; \
popfq; \
subq $(NR_SKIPPED_REGS*8),%rsp; \
pushq %rdi; \
pushq %rsi; \
pushq %rdx; \
pushq %rcx; \
pushq %rax; \
pushq %r8; \
pushq %r9; \
pushq %r10; \
pushq %r11; \
pushq %rbx; \
pushq %rbp; \
pushq %r12; \
pushq %r13; \
pushq %r14; \
pushq %r15;
#define VMRUN .byte 0x0F,0x01,0xD8
#define STGI .byte 0x0F,0x01,0xDC
#define CLGI .byte 0x0F,0x01,0xDD
ENTRY(svm_asm_do_resume)
GET_CURRENT(%rbx)
cli # tests must not race interrupts
CLGI
movl VCPU_processor(%rbx),%eax
shl $IRQSTAT_shift,%rax
leaq irq_stat(%rip),%rdx
@@ -68,9 +46,6 @@ ENTRY(svm_asm_do_resume)
call svm_intr_assist
call svm_load_cr2
CLGI
sti
GET_CURRENT(%rbx)
movq VCPU_svm_vmcb(%rbx),%rcx
movq UREGS_rax(%rsp),%rax
movq %rax,VMCB_rax(%rcx)
@@ -91,11 +66,24 @@ ENTRY(svm_asm_do_resume)
popq %rdx
popq %rsi
popq %rdi
addq $(NR_SKIPPED_REGS*8),%rsp
VMRUN
HVM_SAVE_ALL_NOSEGREGS
pushq %rdi
pushq %rsi
pushq %rdx
pushq %rcx
pushq %rax
pushq %r8
pushq %r9
pushq %r10
pushq %r11
pushq %rbx
pushq %rbp
pushq %r12
pushq %r13
pushq %r14
pushq %r15
GET_CURRENT(%rbx)
movb $0,VCPU_svm_vmcb_in_sync(%rbx)
@@ -112,6 +100,6 @@ svm_stgi_label:
ALIGN
svm_process_softirqs:
sti
STGI
call do_softirq
jmp svm_asm_do_resume
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.