ia64/xen-unstable

changeset 15091:65ce4866d20b

svm: Simplify asm stub for vmentry/vmexit.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Sat May 12 19:22:24 2007 +0100 (2007-05-12)
parents 384a29655270
children 3ecf51689671
files xen/arch/x86/hvm/svm/x86_32/exits.S xen/arch/x86/hvm/svm/x86_64/exits.S
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/x86_32/exits.S	Sat May 12 19:04:35 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/x86_32/exits.S	Sat May 12 19:22:24 2007 +0100
     1.3 @@ -31,26 +31,13 @@
     1.4          andl $~3,reg;            \
     1.5          movl (reg),reg;
     1.6  
     1.7 -#define HVM_MONITOR_EFLAGS 0x202 /* IF on */
     1.8 -#define NR_SKIPPED_REGS    7     /* Skip SS thru EAX */
     1.9 -#define HVM_SAVE_ALL_NOSEGREGS                  \
    1.10 -        pushl $HVM_MONITOR_EFLAGS;              \
    1.11 -        popf;                                   \
    1.12 -        subl $(NR_SKIPPED_REGS*4),%esp;         \
    1.13 -        pushl %ebp;                             \
    1.14 -        pushl %edi;                             \
    1.15 -        pushl %esi;                             \
    1.16 -        pushl %edx;                             \
    1.17 -        pushl %ecx;                             \
    1.18 -        pushl %ebx;
    1.19 -
    1.20  #define VMRUN  .byte 0x0F,0x01,0xD8
    1.21  #define STGI   .byte 0x0F,0x01,0xDC
    1.22  #define CLGI   .byte 0x0F,0x01,0xDD
    1.23  
    1.24  ENTRY(svm_asm_do_resume)
    1.25          GET_CURRENT(%ebx)
    1.26 -        cli                             # tests must not race interrupts
    1.27 +        CLGI
    1.28          movl VCPU_processor(%ebx),%eax
    1.29          shl  $IRQSTAT_shift,%eax
    1.30          testl $~0,irq_stat(%eax,1)
    1.31 @@ -58,9 +45,6 @@ ENTRY(svm_asm_do_resume)
    1.32          call svm_intr_assist
    1.33          call svm_load_cr2
    1.34  
    1.35 -        CLGI                
    1.36 -        sti
    1.37 -        GET_CURRENT(%ebx)
    1.38          movl VCPU_svm_vmcb(%ebx),%ecx
    1.39          movl UREGS_eax(%esp),%eax
    1.40          movl %eax,VMCB_rax(%ecx)
    1.41 @@ -72,11 +56,15 @@ ENTRY(svm_asm_do_resume)
    1.42          popl %esi
    1.43          popl %edi
    1.44          popl %ebp
    1.45 -        addl $(NR_SKIPPED_REGS*4),%esp
    1.46  
    1.47          VMRUN
    1.48  
    1.49 -        HVM_SAVE_ALL_NOSEGREGS
    1.50 +        pushl %ebp
    1.51 +        pushl %edi
    1.52 +        pushl %esi
    1.53 +        pushl %edx
    1.54 +        pushl %ecx
    1.55 +        pushl %ebx
    1.56  
    1.57          GET_CURRENT(%ebx)
    1.58          movb $0,VCPU_svm_vmcb_in_sync(%ebx)
    1.59 @@ -95,6 +83,6 @@ svm_stgi_label:
    1.60  
    1.61          ALIGN
    1.62  svm_process_softirqs:
    1.63 -        sti       
    1.64 +        STGI
    1.65          call do_softirq
    1.66          jmp  svm_asm_do_resume
     2.1 --- a/xen/arch/x86/hvm/svm/x86_64/exits.S	Sat May 12 19:04:35 2007 +0100
     2.2 +++ b/xen/arch/x86/hvm/svm/x86_64/exits.S	Sat May 12 19:22:24 2007 +0100
     2.3 @@ -31,35 +31,13 @@
     2.4          andq $~7,reg;            \
     2.5          movq (reg),reg;
     2.6  
     2.7 -#define HVM_MONITOR_RFLAGS 0x202 /* IF on */
     2.8 -#define NR_SKIPPED_REGS    6     /* Skip SS thru error_code */
     2.9 -#define HVM_SAVE_ALL_NOSEGREGS                  \
    2.10 -        pushq $HVM_MONITOR_RFLAGS;              \
    2.11 -        popfq;                                  \
    2.12 -        subq $(NR_SKIPPED_REGS*8),%rsp;         \
    2.13 -        pushq %rdi;                             \
    2.14 -        pushq %rsi;                             \
    2.15 -        pushq %rdx;                             \
    2.16 -        pushq %rcx;                             \
    2.17 -        pushq %rax;                             \
    2.18 -        pushq %r8;                              \
    2.19 -        pushq %r9;                              \
    2.20 -        pushq %r10;                             \
    2.21 -        pushq %r11;                             \
    2.22 -        pushq %rbx;                             \
    2.23 -        pushq %rbp;                             \
    2.24 -        pushq %r12;                             \
    2.25 -        pushq %r13;                             \
    2.26 -        pushq %r14;                             \
    2.27 -        pushq %r15;
    2.28 -
    2.29  #define VMRUN  .byte 0x0F,0x01,0xD8
    2.30  #define STGI   .byte 0x0F,0x01,0xDC
    2.31  #define CLGI   .byte 0x0F,0x01,0xDD
    2.32  
    2.33  ENTRY(svm_asm_do_resume)
    2.34          GET_CURRENT(%rbx)
    2.35 -        cli                             # tests must not race interrupts
    2.36 +        CLGI
    2.37          movl VCPU_processor(%rbx),%eax
    2.38          shl  $IRQSTAT_shift,%rax
    2.39          leaq irq_stat(%rip),%rdx
    2.40 @@ -68,9 +46,6 @@ ENTRY(svm_asm_do_resume)
    2.41          call svm_intr_assist
    2.42          call svm_load_cr2
    2.43  
    2.44 -        CLGI                
    2.45 -        sti
    2.46 -        GET_CURRENT(%rbx)
    2.47          movq VCPU_svm_vmcb(%rbx),%rcx
    2.48          movq UREGS_rax(%rsp),%rax
    2.49          movq %rax,VMCB_rax(%rcx)
    2.50 @@ -91,11 +66,24 @@ ENTRY(svm_asm_do_resume)
    2.51          popq %rdx
    2.52          popq %rsi
    2.53          popq %rdi
    2.54 -        addq $(NR_SKIPPED_REGS*8),%rsp
    2.55  
    2.56          VMRUN
    2.57  
    2.58 -        HVM_SAVE_ALL_NOSEGREGS
    2.59 +        pushq %rdi
    2.60 +        pushq %rsi
    2.61 +        pushq %rdx
    2.62 +        pushq %rcx
    2.63 +        pushq %rax
    2.64 +        pushq %r8
    2.65 +        pushq %r9
    2.66 +        pushq %r10
    2.67 +        pushq %r11
    2.68 +        pushq %rbx
    2.69 +        pushq %rbp
    2.70 +        pushq %r12
    2.71 +        pushq %r13
    2.72 +        pushq %r14
    2.73 +        pushq %r15
    2.74  
    2.75          GET_CURRENT(%rbx)
    2.76          movb $0,VCPU_svm_vmcb_in_sync(%rbx)
    2.77 @@ -112,6 +100,6 @@ svm_stgi_label:
    2.78  
    2.79          ALIGN
    2.80  svm_process_softirqs:
    2.81 -        sti
    2.82 +        STGI
    2.83          call do_softirq
    2.84          jmp  svm_asm_do_resume