ia64/xen-unstable

changeset 17490:d03f1c098a1e

x86, hvm: Merge 32-bit and 64-bit asm stubs into common files.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 21 14:55:15 2008 +0100 (2008-04-21)
parents 491074885dcb
children 84b5dee690f5
files xen/arch/x86/hvm/svm/Makefile xen/arch/x86/hvm/svm/entry.S xen/arch/x86/hvm/svm/x86_32/Makefile xen/arch/x86/hvm/svm/x86_32/exits.S xen/arch/x86/hvm/svm/x86_64/Makefile xen/arch/x86/hvm/svm/x86_64/exits.S xen/arch/x86/hvm/vmx/Makefile xen/arch/x86/hvm/vmx/entry.S xen/arch/x86/hvm/vmx/x86_32/Makefile xen/arch/x86/hvm/vmx/x86_32/exits.S xen/arch/x86/hvm/vmx/x86_64/Makefile xen/arch/x86/hvm/vmx/x86_64/exits.S
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/Makefile	Mon Apr 21 12:23:55 2008 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/Makefile	Mon Apr 21 14:55:15 2008 +0100
     1.3 @@ -1,8 +1,6 @@
     1.4 -subdir-$(x86_32) += x86_32
     1.5 -subdir-$(x86_64) += x86_64
     1.6 -
     1.7  obj-y += asid.o
     1.8  obj-y += emulate.o
     1.9 +obj-y += entry.o
    1.10  obj-y += intr.o
    1.11  obj-y += svm.o
    1.12  obj-y += vmcb.o
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/arch/x86/hvm/svm/entry.S	Mon Apr 21 14:55:15 2008 +0100
     2.3 @@ -0,0 +1,178 @@
     2.4 +/*
     2.5 + * entry.S: SVM architecture-specific entry/exit handling.
     2.6 + * Copyright (c) 2005-2007, Advanced Micro Devices, Inc.
     2.7 + * Copyright (c) 2004, Intel Corporation.
     2.8 + * Copyright (c) 2008, Citrix Systems, Inc.
     2.9 + *
    2.10 + * This program is free software; you can redistribute it and/or modify it
    2.11 + * under the terms and conditions of the GNU General Public License,
    2.12 + * version 2, as published by the Free Software Foundation.
    2.13 + *
    2.14 + * This program is distributed in the hope it will be useful, but WITHOUT
    2.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    2.17 + * more details.
    2.18 + *
    2.19 + * You should have received a copy of the GNU General Public License along with
    2.20 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    2.21 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    2.22 + */
    2.23 +
    2.24 +#include <xen/config.h>
    2.25 +#include <xen/errno.h>
    2.26 +#include <xen/softirq.h>
    2.27 +#include <asm/types.h>
    2.28 +#include <asm/asm_defns.h>
    2.29 +#include <asm/apicdef.h>
    2.30 +#include <asm/page.h>
    2.31 +#include <public/xen.h>
    2.32 +
    2.33 +#define VMRUN  .byte 0x0F,0x01,0xD8
    2.34 +#define STGI   .byte 0x0F,0x01,0xDC
    2.35 +#define CLGI   .byte 0x0F,0x01,0xDD
    2.36 +
    2.37 +#define get_current(reg)                        \
    2.38 +        mov $STACK_SIZE-BYTES_PER_LONG, r(reg); \
    2.39 +        or  r(sp), r(reg);                      \
    2.40 +        and $~(BYTES_PER_LONG-1),r(reg);        \
    2.41 +        mov (r(reg)),r(reg);
    2.42 +
    2.43 +#if defined(__x86_64__)
    2.44 +#define r(reg) %r##reg
    2.45 +#define addr_of(lbl) lbl(%rip)
    2.46 +#define call_with_regs(fn)                      \
    2.47 +        mov  %rsp,%rdi;                         \
    2.48 +        call fn;
    2.49 +#else /* defined(__i386__) */
    2.50 +#define r(reg) %e##reg
    2.51 +#define addr_of(lbl) lbl
    2.52 +#define UREGS_rax UREGS_eax
    2.53 +#define UREGS_rip UREGS_eip
    2.54 +#define UREGS_rsp UREGS_esp
    2.55 +#define call_with_regs(fn)                      \
    2.56 +        mov  %esp,%eax;                         \
    2.57 +        push %eax;                              \
    2.58 +        call fn;                                \
    2.59 +        add  $4,%esp;
    2.60 +#endif
    2.61 +
    2.62 +ENTRY(svm_asm_do_resume)
    2.63 +        get_current(bx)
    2.64 +        CLGI
    2.65 +
    2.66 +        mov  VCPU_processor(r(bx)),%eax
    2.67 +        shl  $IRQSTAT_shift,r(ax)
    2.68 +        lea  addr_of(irq_stat),r(dx)
    2.69 +        testl $~0,(r(dx),r(ax),1)
    2.70 +        jnz  .Lsvm_process_softirqs
    2.71 +
    2.72 +        call svm_asid_handle_vmrun
    2.73 +        call svm_intr_assist
    2.74 +
    2.75 +        cmpb $0,addr_of(tb_init_done)
    2.76 +        jnz  .Lsvm_trace
    2.77 +.Lsvm_trace_done:
    2.78 +
    2.79 +        mov  VCPU_svm_vmcb(r(bx)),r(cx)
    2.80 +        mov  UREGS_rax(r(sp)),r(ax)
    2.81 +        mov  r(ax),VMCB_rax(r(cx))
    2.82 +        mov  UREGS_rip(r(sp)),r(ax)
    2.83 +        mov  r(ax),VMCB_rip(r(cx))
    2.84 +        mov  UREGS_rsp(r(sp)),r(ax)
    2.85 +        mov  r(ax),VMCB_rsp(r(cx))
    2.86 +        mov  UREGS_eflags(r(sp)),r(ax)
    2.87 +        mov  r(ax),VMCB_rflags(r(cx))
    2.88 +
    2.89 +        mov  VCPU_svm_vmcb_pa(r(bx)),r(ax)
    2.90 +
    2.91 +#if defined(__x86_64__)
    2.92 +        pop  %r15
    2.93 +        pop  %r14
    2.94 +        pop  %r13
    2.95 +        pop  %r12
    2.96 +        pop  %rbp
    2.97 +        pop  %rbx
    2.98 +        pop  %r11
    2.99 +        pop  %r10
   2.100 +        pop  %r9
   2.101 +        pop  %r8
   2.102 +        add  $8,%rsp /* Skip %rax: restored by VMRUN. */
   2.103 +        pop  %rcx
   2.104 +        pop  %rdx
   2.105 +        pop  %rsi
   2.106 +        pop  %rdi
   2.107 +#else /* defined(__i386__) */
   2.108 +        pop  %ebx
   2.109 +        pop  %ecx
   2.110 +        pop  %edx
   2.111 +        pop  %esi
   2.112 +        pop  %edi
   2.113 +        pop  %ebp
   2.114 +#endif
   2.115 +
   2.116 +        VMRUN
   2.117 +
   2.118 +#if defined(__x86_64__)
   2.119 +        push %rdi
   2.120 +        push %rsi
   2.121 +        push %rdx
   2.122 +        push %rcx
   2.123 +        push %rax
   2.124 +        push %r8
   2.125 +        push %r9
   2.126 +        push %r10
   2.127 +        push %r11
   2.128 +        push %rbx
   2.129 +        push %rbp
   2.130 +        push %r12
   2.131 +        push %r13
   2.132 +        push %r14
   2.133 +        push %r15
   2.134 +#else /* defined(__i386__) */
   2.135 +        push %ebp
   2.136 +        push %edi
   2.137 +        push %esi
   2.138 +        push %edx
   2.139 +        push %ecx
   2.140 +        push %ebx
   2.141 +#endif
   2.142 +
   2.143 +        get_current(bx)
   2.144 +        movb $0,VCPU_svm_vmcb_in_sync(r(bx))
   2.145 +        mov  VCPU_svm_vmcb(r(bx)),r(cx)
   2.146 +        mov  VMCB_rax(r(cx)),r(ax)
   2.147 +        mov  r(ax),UREGS_rax(r(sp))
   2.148 +        mov  VMCB_rip(r(cx)),r(ax)
   2.149 +        mov  r(ax),UREGS_rip(r(sp))
   2.150 +        mov  VMCB_rsp(r(cx)),r(ax)
   2.151 +        mov  r(ax),UREGS_rsp(r(sp))
   2.152 +        mov  VMCB_rflags(r(cx)),r(ax)
   2.153 +        mov  r(ax),UREGS_eflags(r(sp))
   2.154 +
   2.155 +#ifndef NDEBUG
   2.156 +        mov  $0xbeef,%ax
   2.157 +        mov  %ax,UREGS_error_code(r(sp))
   2.158 +        mov  %ax,UREGS_entry_vector(r(sp))
   2.159 +        mov  %ax,UREGS_saved_upcall_mask(r(sp))
   2.160 +        mov  %ax,UREGS_cs(r(sp))
   2.161 +        mov  %ax,UREGS_ds(r(sp))
   2.162 +        mov  %ax,UREGS_es(r(sp))
   2.163 +        mov  %ax,UREGS_fs(r(sp))
   2.164 +        mov  %ax,UREGS_gs(r(sp))
   2.165 +        mov  %ax,UREGS_ss(r(sp))
   2.166 +#endif
   2.167 +
   2.168 +        STGI
   2.169 +.globl svm_stgi_label
   2.170 +svm_stgi_label:
   2.171 +        call_with_regs(svm_vmexit_handler)
   2.172 +        jmp  svm_asm_do_resume
   2.173 +
   2.174 +.Lsvm_process_softirqs:
   2.175 +        STGI
   2.176 +        call do_softirq
   2.177 +        jmp  svm_asm_do_resume
   2.178 +
   2.179 +.Lsvm_trace:
   2.180 +        call svm_trace_vmentry
   2.181 +        jmp  .Lsvm_trace_done
     3.1 --- a/xen/arch/x86/hvm/svm/x86_32/Makefile	Mon Apr 21 12:23:55 2008 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,1 +0,0 @@
     3.4 -obj-y += exits.o
     4.1 --- a/xen/arch/x86/hvm/svm/x86_32/exits.S	Mon Apr 21 12:23:55 2008 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,126 +0,0 @@
     4.4 -/*
     4.5 - * exits.S: SVM architecture-specific exit handling.
     4.6 - * Copyright (c) 2005-2007, Advanced Micro Devices, Inc.
     4.7 - * Copyright (c) 2004, Intel Corporation.
     4.8 - *
     4.9 - * This program is free software; you can redistribute it and/or modify it
    4.10 - * under the terms and conditions of the GNU General Public License,
    4.11 - * version 2, as published by the Free Software Foundation.
    4.12 - *
    4.13 - * This program is distributed in the hope it will be useful, but WITHOUT
    4.14 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.15 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    4.16 - * more details.
    4.17 - *
    4.18 - * You should have received a copy of the GNU General Public License along with
    4.19 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    4.20 - * Place - Suite 330, Boston, MA 02111-1307 USA.
    4.21 - */
    4.22 -
    4.23 -#include <xen/config.h>
    4.24 -#include <xen/errno.h>
    4.25 -#include <xen/softirq.h>
    4.26 -#include <asm/asm_defns.h>
    4.27 -#include <asm/apicdef.h>
    4.28 -#include <asm/page.h>
    4.29 -#include <public/xen.h>
    4.30 -
    4.31 -#define GET_CURRENT(reg)         \
    4.32 -        movl $STACK_SIZE-4,reg;  \
    4.33 -        orl  %esp,reg;           \
    4.34 -        andl $~3,reg;            \
    4.35 -        movl (reg),reg;
    4.36 -
    4.37 -#define VMRUN  .byte 0x0F,0x01,0xD8
    4.38 -#define STGI   .byte 0x0F,0x01,0xDC
    4.39 -#define CLGI   .byte 0x0F,0x01,0xDD
    4.40 -
    4.41 -ENTRY(svm_asm_do_resume)
    4.42 -        GET_CURRENT(%ebx)
    4.43 -        CLGI
    4.44 -
    4.45 -        movl VCPU_processor(%ebx),%eax
    4.46 -        shl  $IRQSTAT_shift,%eax
    4.47 -        testl $~0,irq_stat(%eax,1)
    4.48 -        jnz  .Lsvm_process_softirqs
    4.49 -
    4.50 -        call svm_asid_handle_vmrun
    4.51 -        call svm_intr_assist
    4.52 -
    4.53 -        /* Check if the trace buffer is initialized. 
    4.54 -         * Because the below condition is unlikely, we jump out of line
    4.55 -         * instead of having a mostly taken branch over the unlikely code.
    4.56 -         */
    4.57 -        cmpb $0,tb_init_done
    4.58 -        jnz  .Lsvm_trace
    4.59 -.Lsvm_trace_done:
    4.60 -
    4.61 -        movl VCPU_svm_vmcb(%ebx),%ecx
    4.62 -        movl UREGS_eax(%esp),%eax
    4.63 -        movl %eax,VMCB_rax(%ecx)
    4.64 -        movl UREGS_eip(%esp),%eax
    4.65 -        movl %eax,VMCB_rip(%ecx)
    4.66 -        movl UREGS_esp(%esp),%eax
    4.67 -        movl %eax,VMCB_rsp(%ecx)
    4.68 -        movl UREGS_eflags(%esp),%eax
    4.69 -        movl %eax,VMCB_rflags(%ecx)
    4.70 -
    4.71 -        movl VCPU_svm_vmcb_pa(%ebx),%eax
    4.72 -        popl %ebx
    4.73 -        popl %ecx
    4.74 -        popl %edx
    4.75 -        popl %esi
    4.76 -        popl %edi
    4.77 -        popl %ebp
    4.78 -
    4.79 -        VMRUN
    4.80 -
    4.81 -        pushl %ebp
    4.82 -        pushl %edi
    4.83 -        pushl %esi
    4.84 -        pushl %edx
    4.85 -        pushl %ecx
    4.86 -        pushl %ebx
    4.87 -
    4.88 -        GET_CURRENT(%ebx)
    4.89 -        movb $0,VCPU_svm_vmcb_in_sync(%ebx)
    4.90 -        movl VCPU_svm_vmcb(%ebx),%ecx
    4.91 -        movl VMCB_rax(%ecx),%eax
    4.92 -        movl %eax,UREGS_eax(%esp)
    4.93 -        movl VMCB_rip(%ecx),%eax
    4.94 -        movl %eax,UREGS_eip(%esp)
    4.95 -        movl VMCB_rsp(%ecx),%eax
    4.96 -        movl %eax,UREGS_esp(%esp)
    4.97 -        movl VMCB_rflags(%ecx),%eax
    4.98 -        movl %eax,UREGS_eflags(%esp)
    4.99 -
   4.100 -#ifndef NDEBUG
   4.101 -        movw $0xbeef,%ax
   4.102 -        movw %ax,UREGS_error_code(%esp)
   4.103 -        movw %ax,UREGS_entry_vector(%esp)
   4.104 -        movw %ax,UREGS_saved_upcall_mask(%esp)
   4.105 -        movw %ax,UREGS_cs(%esp)
   4.106 -        movw %ax,UREGS_ds(%esp)
   4.107 -        movw %ax,UREGS_es(%esp)
   4.108 -        movw %ax,UREGS_fs(%esp)
   4.109 -        movw %ax,UREGS_gs(%esp)
   4.110 -        movw %ax,UREGS_ss(%esp)
   4.111 -#endif
   4.112 -
   4.113 -        STGI
   4.114 -.globl svm_stgi_label
   4.115 -svm_stgi_label:
   4.116 -        movl %esp,%eax
   4.117 -        push %eax
   4.118 -        call svm_vmexit_handler
   4.119 -        addl $4,%esp
   4.120 -        jmp  svm_asm_do_resume
   4.121 -
   4.122 -.Lsvm_process_softirqs:
   4.123 -        STGI
   4.124 -        call do_softirq
   4.125 -        jmp  svm_asm_do_resume
   4.126 -
   4.127 -.Lsvm_trace:
   4.128 -        call svm_trace_vmentry
   4.129 -        jmp  .Lsvm_trace_done
     5.1 --- a/xen/arch/x86/hvm/svm/x86_64/Makefile	Mon Apr 21 12:23:55 2008 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,1 +0,0 @@
     5.4 -obj-y += exits.o
     6.1 --- a/xen/arch/x86/hvm/svm/x86_64/exits.S	Mon Apr 21 12:23:55 2008 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,143 +0,0 @@
     6.4 -/*
     6.5 - * exits.S: AMD-V architecture-specific exit handling.
     6.6 - * Copyright (c) 2005-2007, Advanced Micro Devices, Inc.
     6.7 - * Copyright (c) 2004, Intel Corporation.
     6.8 - *
     6.9 - * This program is free software; you can redistribute it and/or modify it
    6.10 - * under the terms and conditions of the GNU General Public License,
    6.11 - * version 2, as published by the Free Software Foundation.
    6.12 - *
    6.13 - * This program is distributed in the hope it will be useful, but WITHOUT
    6.14 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    6.15 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    6.16 - * more details.
    6.17 - *
    6.18 - * You should have received a copy of the GNU General Public License along with
    6.19 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    6.20 - * Place - Suite 330, Boston, MA 02111-1307 USA.
    6.21 - */
    6.22 -
    6.23 -#include <xen/config.h>
    6.24 -#include <xen/errno.h>
    6.25 -#include <xen/softirq.h>
    6.26 -#include <asm/asm_defns.h>
    6.27 -#include <asm/apicdef.h>
    6.28 -#include <asm/page.h>
    6.29 -#include <public/xen.h>
    6.30 -
    6.31 -#define GET_CURRENT(reg)         \
    6.32 -        movq $STACK_SIZE-8,reg;  \
    6.33 -        orq  %rsp,reg;           \
    6.34 -        andq $~7,reg;            \
    6.35 -        movq (reg),reg;
    6.36 -
    6.37 -#define VMRUN  .byte 0x0F,0x01,0xD8
    6.38 -#define STGI   .byte 0x0F,0x01,0xDC
    6.39 -#define CLGI   .byte 0x0F,0x01,0xDD
    6.40 -
    6.41 -ENTRY(svm_asm_do_resume)
    6.42 -        GET_CURRENT(%rbx)
    6.43 -        CLGI
    6.44 -
    6.45 -        movl VCPU_processor(%rbx),%eax
    6.46 -        shl  $IRQSTAT_shift,%rax
    6.47 -        leaq irq_stat(%rip),%rdx
    6.48 -        testl $~0,(%rdx,%rax,1)
    6.49 -        jnz  .Lsvm_process_softirqs
    6.50 -
    6.51 -        call svm_asid_handle_vmrun
    6.52 -        call svm_intr_assist
    6.53 -
    6.54 -        /* Check if the trace buffer is initialized. 
    6.55 -         * Because the below condition is unlikely, we jump out of line
    6.56 -         * instead of having a mostly taken branch over the unlikely code.
    6.57 -         */
    6.58 -        cmpb $0,tb_init_done(%rip)
    6.59 -        jnz  .Lsvm_trace
    6.60 -.Lsvm_trace_done:
    6.61 -
    6.62 -        movq VCPU_svm_vmcb(%rbx),%rcx
    6.63 -        movq UREGS_rax(%rsp),%rax
    6.64 -        movq %rax,VMCB_rax(%rcx)
    6.65 -        movq UREGS_rip(%rsp),%rax
    6.66 -        movq %rax,VMCB_rip(%rcx)
    6.67 -        movq UREGS_rsp(%rsp),%rax
    6.68 -        movq %rax,VMCB_rsp(%rcx)
    6.69 -        movq UREGS_eflags(%rsp),%rax
    6.70 -        movq %rax,VMCB_rflags(%rcx)
    6.71 -
    6.72 -        movq VCPU_svm_vmcb_pa(%rbx),%rax
    6.73 -        popq %r15
    6.74 -        popq %r14
    6.75 -        popq %r13
    6.76 -        popq %r12
    6.77 -        popq %rbp
    6.78 -        popq %rbx
    6.79 -        popq %r11
    6.80 -        popq %r10
    6.81 -        popq %r9
    6.82 -        popq %r8
    6.83 -        addq $8,%rsp /* Skip %rax: restored by VMRUN. */
    6.84 -        popq %rcx
    6.85 -        popq %rdx
    6.86 -        popq %rsi
    6.87 -        popq %rdi
    6.88 -
    6.89 -        VMRUN
    6.90 -
    6.91 -        pushq %rdi
    6.92 -        pushq %rsi
    6.93 -        pushq %rdx
    6.94 -        pushq %rcx
    6.95 -        pushq %rax
    6.96 -        pushq %r8
    6.97 -        pushq %r9
    6.98 -        pushq %r10
    6.99 -        pushq %r11
   6.100 -        pushq %rbx
   6.101 -        pushq %rbp
   6.102 -        pushq %r12
   6.103 -        pushq %r13
   6.104 -        pushq %r14
   6.105 -        pushq %r15
   6.106 -
   6.107 -        GET_CURRENT(%rbx)
   6.108 -        movb $0,VCPU_svm_vmcb_in_sync(%rbx)
   6.109 -        movq VCPU_svm_vmcb(%rbx),%rcx
   6.110 -        movq VMCB_rax(%rcx),%rax
   6.111 -        movq %rax,UREGS_rax(%rsp)
   6.112 -        movq VMCB_rip(%rcx),%rax
   6.113 -        movq %rax,UREGS_rip(%rsp)
   6.114 -        movq VMCB_rsp(%rcx),%rax
   6.115 -        movq %rax,UREGS_rsp(%rsp)
   6.116 -        movq VMCB_rflags(%rcx),%rax
   6.117 -        movq %rax,UREGS_eflags(%rsp)
   6.118 -
   6.119 -#ifndef NDEBUG
   6.120 -        movw $0xbeef,%ax
   6.121 -        movw %ax,UREGS_error_code(%rsp)
   6.122 -        movw %ax,UREGS_entry_vector(%rsp)
   6.123 -        movw %ax,UREGS_saved_upcall_mask(%rsp)
   6.124 -        movw %ax,UREGS_cs(%rsp)
   6.125 -        movw %ax,UREGS_ds(%rsp)
   6.126 -        movw %ax,UREGS_es(%rsp)
   6.127 -        movw %ax,UREGS_fs(%rsp)
   6.128 -        movw %ax,UREGS_gs(%rsp)
   6.129 -        movw %ax,UREGS_ss(%rsp)
   6.130 -#endif
   6.131 -
   6.132 -        STGI
   6.133 -.globl svm_stgi_label
   6.134 -svm_stgi_label:
   6.135 -        movq %rsp,%rdi
   6.136 -        call svm_vmexit_handler
   6.137 -        jmp  svm_asm_do_resume
   6.138 -
   6.139 -.Lsvm_process_softirqs:
   6.140 -        STGI
   6.141 -        call do_softirq
   6.142 -        jmp  svm_asm_do_resume
   6.143 -
   6.144 -.Lsvm_trace:
   6.145 -        call svm_trace_vmentry
   6.146 -        jmp  .Lsvm_trace_done
     7.1 --- a/xen/arch/x86/hvm/vmx/Makefile	Mon Apr 21 12:23:55 2008 +0100
     7.2 +++ b/xen/arch/x86/hvm/vmx/Makefile	Mon Apr 21 14:55:15 2008 +0100
     7.3 @@ -1,6 +1,4 @@
     7.4 -subdir-$(x86_32) += x86_32
     7.5 -subdir-$(x86_64) += x86_64
     7.6 -
     7.7 +obj-y += entry.o
     7.8  obj-y += intr.o
     7.9  obj-y += realmode.o
    7.10  obj-y += vmcs.o
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/xen/arch/x86/hvm/vmx/entry.S	Mon Apr 21 14:55:15 2008 +0100
     8.3 @@ -0,0 +1,198 @@
     8.4 +/*
     8.5 + * entry.S: VMX architecture-specific entry/exit handling.
     8.6 + * Copyright (c) 2004, Intel Corporation.
     8.7 + * Copyright (c) 2008, Citrix Systems, Inc.
     8.8 + *
     8.9 + * This program is free software; you can redistribute it and/or modify it
    8.10 + * under the terms and conditions of the GNU General Public License,
    8.11 + * version 2, as published by the Free Software Foundation.
    8.12 + *
    8.13 + * This program is distributed in the hope it will be useful, but WITHOUT
    8.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    8.15 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    8.16 + * more details.
    8.17 + *
    8.18 + * You should have received a copy of the GNU General Public License along with
    8.19 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    8.20 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    8.21 + */
    8.22 +
    8.23 +#include <xen/config.h>
    8.24 +#include <xen/errno.h>
    8.25 +#include <xen/softirq.h>
    8.26 +#include <asm/types.h>
    8.27 +#include <asm/asm_defns.h>
    8.28 +#include <asm/apicdef.h>
    8.29 +#include <asm/page.h>
    8.30 +#include <public/xen.h>
    8.31 +
    8.32 +#define VMRESUME     .byte 0x0f,0x01,0xc3
    8.33 +#define VMLAUNCH     .byte 0x0f,0x01,0xc2
    8.34 +#define VMREAD(off)  .byte 0x0f,0x78,0x47,((off)-UREGS_rip)
    8.35 +#define VMWRITE(off) .byte 0x0f,0x79,0x47,((off)-UREGS_rip)
    8.36 +
    8.37 +/* VMCS field encodings */
    8.38 +#define GUEST_RSP    0x681c
    8.39 +#define GUEST_RIP    0x681e
    8.40 +#define GUEST_RFLAGS 0x6820
    8.41 +
    8.42 +#define get_current(reg)                        \
    8.43 +        mov $STACK_SIZE-BYTES_PER_LONG, r(reg); \
    8.44 +        or  r(sp), r(reg);                      \
    8.45 +        and $~(BYTES_PER_LONG-1),r(reg);        \
    8.46 +        mov (r(reg)),r(reg);
    8.47 +
    8.48 +#if defined(__x86_64__)
    8.49 +#define r(reg) %r##reg
    8.50 +#define addr_of(lbl) lbl(%rip)
    8.51 +#define call_with_regs(fn)                      \
    8.52 +        mov  %rsp,%rdi;                         \
    8.53 +        call fn;
    8.54 +#else /* defined(__i386__) */
    8.55 +#define r(reg) %e##reg
    8.56 +#define addr_of(lbl) lbl
    8.57 +#define UREGS_rip UREGS_eip
    8.58 +#define UREGS_rsp UREGS_esp
    8.59 +#define call_with_regs(fn)                      \
    8.60 +        mov  %esp,%eax;                         \
    8.61 +        push %eax;                              \
    8.62 +        call fn;                                \
    8.63 +        add  $4,%esp;
    8.64 +#endif
    8.65 +
    8.66 +        ALIGN
    8.67 +.globl vmx_asm_vmexit_handler
    8.68 +vmx_asm_vmexit_handler:
    8.69 +#if defined(__x86_64__)
    8.70 +        push %rdi
    8.71 +        push %rsi
    8.72 +        push %rdx
    8.73 +        push %rcx
    8.74 +        push %rax
    8.75 +        push %r8
    8.76 +        push %r9
    8.77 +        push %r10
    8.78 +        push %r11
    8.79 +        push %rbx
    8.80 +        push %rbp
    8.81 +        push %r12
    8.82 +        push %r13
    8.83 +        push %r14
    8.84 +        push %r15
    8.85 +#else /* defined(__i386__) */
    8.86 +        push %eax
    8.87 +        push %ebp
    8.88 +        push %edi
    8.89 +        push %esi
    8.90 +        push %edx
    8.91 +        push %ecx
    8.92 +        push %ebx
    8.93 +#endif
    8.94 +
    8.95 +        get_current(bx)
    8.96 +
    8.97 +        movb $1,VCPU_vmx_launched(r(bx))
    8.98 +
    8.99 +        lea  UREGS_rip(r(sp)),r(di)
   8.100 +        mov  $GUEST_RIP,%eax
   8.101 +        /*VMREAD(UREGS_rip)*/
   8.102 +        .byte 0x0f,0x78,0x07  /* vmread r(ax),(r(di)) */
   8.103 +        mov  $GUEST_RSP,%eax
   8.104 +        VMREAD(UREGS_rsp)
   8.105 +        mov  $GUEST_RFLAGS,%eax
   8.106 +        VMREAD(UREGS_eflags)
   8.107 +
   8.108 +        mov  %cr2,r(ax)
   8.109 +        mov  r(ax),VCPU_hvm_guest_cr2(r(bx))
   8.110 +
   8.111 +#ifndef NDEBUG
   8.112 +        mov  $0xbeef,%ax
   8.113 +        mov  %ax,UREGS_error_code(r(sp))
   8.114 +        mov  %ax,UREGS_entry_vector(r(sp))
   8.115 +        mov  %ax,UREGS_saved_upcall_mask(r(sp))
   8.116 +        mov  %ax,UREGS_cs(r(sp))
   8.117 +        mov  %ax,UREGS_ds(r(sp))
   8.118 +        mov  %ax,UREGS_es(r(sp))
   8.119 +        mov  %ax,UREGS_fs(r(sp))
   8.120 +        mov  %ax,UREGS_gs(r(sp))
   8.121 +        mov  %ax,UREGS_ss(r(sp))
   8.122 +#endif
   8.123 +
   8.124 +        call_with_regs(vmx_vmexit_handler)
   8.125 +
   8.126 +.globl vmx_asm_do_vmentry
   8.127 +vmx_asm_do_vmentry:
   8.128 +        get_current(bx)
   8.129 +        cli
   8.130 +
   8.131 +        mov  VCPU_processor(r(bx)),%eax
   8.132 +        shl  $IRQSTAT_shift,r(ax)
   8.133 +        lea  addr_of(irq_stat),r(dx)
   8.134 +        cmpl $0,(r(dx),r(ax),1)
   8.135 +        jnz  .Lvmx_process_softirqs
   8.136 +
   8.137 +        call vmx_intr_assist
   8.138 +
   8.139 +        testb $0xff,VCPU_vmx_emul(r(bx))
   8.140 +        jnz  .Lvmx_goto_realmode
   8.141 +
   8.142 +        mov  VCPU_hvm_guest_cr2(r(bx)),r(ax)
   8.143 +        mov  r(ax),%cr2
   8.144 +        call vmx_trace_vmentry
   8.145 +
   8.146 +        lea  UREGS_rip(r(sp)),r(di)
   8.147 +        mov  $GUEST_RIP,%eax
   8.148 +        /*VMWRITE(UREGS_rip)*/
   8.149 +        .byte 0x0f,0x79,0x07  /* vmwrite (r(di)),r(ax) */
   8.150 +        mov  $GUEST_RSP,%eax
   8.151 +        VMWRITE(UREGS_rsp)
   8.152 +        mov  $GUEST_RFLAGS,%eax
   8.153 +        VMWRITE(UREGS_eflags)
   8.154 +
   8.155 +        cmpb $0,VCPU_vmx_launched(r(bx))
   8.156 +#if defined(__x86_64__)
   8.157 +        pop  %r15
   8.158 +        pop  %r14
   8.159 +        pop  %r13
   8.160 +        pop  %r12
   8.161 +        pop  %rbp
   8.162 +        pop  %rbx
   8.163 +        pop  %r11
   8.164 +        pop  %r10
   8.165 +        pop  %r9
   8.166 +        pop  %r8
   8.167 +        pop  %rax
   8.168 +        pop  %rcx
   8.169 +        pop  %rdx
   8.170 +        pop  %rsi
   8.171 +        pop  %rdi
   8.172 +#else /* defined(__i386__) */
   8.173 +        pop  %ebx
   8.174 +        pop  %ecx
   8.175 +        pop  %edx
   8.176 +        pop  %esi
   8.177 +        pop  %edi
   8.178 +        pop  %ebp
   8.179 +        pop  %eax
   8.180 +#endif
   8.181 +        je   .Lvmx_launch
   8.182 +
   8.183 +/*.Lvmx_resume:*/
   8.184 +        VMRESUME
   8.185 +        call vm_resume_fail
   8.186 +        ud2
   8.187 +
   8.188 +.Lvmx_launch:
   8.189 +        VMLAUNCH
   8.190 +        call vm_launch_fail
   8.191 +        ud2
   8.192 +
   8.193 +.Lvmx_goto_realmode:
   8.194 +        sti
   8.195 +        call_with_regs(vmx_realmode)
   8.196 +        jmp  vmx_asm_do_vmentry
   8.197 +
   8.198 +.Lvmx_process_softirqs:
   8.199 +        sti
   8.200 +        call do_softirq
   8.201 +        jmp  vmx_asm_do_vmentry
     9.1 --- a/xen/arch/x86/hvm/vmx/x86_32/Makefile	Mon Apr 21 12:23:55 2008 +0100
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,1 +0,0 @@
     9.4 -obj-y += exits.o
    10.1 --- a/xen/arch/x86/hvm/vmx/x86_32/exits.S	Mon Apr 21 12:23:55 2008 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,147 +0,0 @@
    10.4 -/*
    10.5 - * exits.S: VMX architecture-specific exit handling.
    10.6 - * Copyright (c) 2004, Intel Corporation.
    10.7 - *
    10.8 - * This program is free software; you can redistribute it and/or modify it
    10.9 - * under the terms and conditions of the GNU General Public License,
   10.10 - * version 2, as published by the Free Software Foundation.
   10.11 - *
   10.12 - * This program is distributed in the hope it will be useful, but WITHOUT
   10.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   10.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   10.15 - * more details.
   10.16 - *
   10.17 - * You should have received a copy of the GNU General Public License along with
   10.18 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   10.19 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   10.20 - */
   10.21 -#include <xen/config.h>
   10.22 -#include <xen/errno.h>
   10.23 -#include <xen/softirq.h>
   10.24 -#include <asm/asm_defns.h>
   10.25 -#include <asm/apicdef.h>
   10.26 -#include <asm/page.h>
   10.27 -#include <public/xen.h>
   10.28 -
   10.29 -#define VMRESUME     .byte 0x0f,0x01,0xc3
   10.30 -#define VMLAUNCH     .byte 0x0f,0x01,0xc2
   10.31 -#define VMREAD(off)  .byte 0x0f,0x78,0x44,0x24,off
   10.32 -#define VMWRITE(off) .byte 0x0f,0x79,0x44,0x24,off
   10.33 -
   10.34 -/* VMCS field encodings */
   10.35 -#define GUEST_RSP    0x681c
   10.36 -#define GUEST_RIP    0x681e
   10.37 -#define GUEST_RFLAGS 0x6820
   10.38 -
   10.39 -#define GET_CURRENT(reg)         \
   10.40 -        movl $STACK_SIZE-4, reg; \
   10.41 -        orl  %esp, reg;          \
   10.42 -        andl $~3,reg;            \
   10.43 -        movl (reg),reg;
   10.44 -
   10.45 -#define HVM_SAVE_ALL_NOSEGREGS                                              \
   10.46 -        pushl %eax;                                                         \
   10.47 -        pushl %ebp;                                                         \
   10.48 -        pushl %edi;                                                         \
   10.49 -        pushl %esi;                                                         \
   10.50 -        pushl %edx;                                                         \
   10.51 -        pushl %ecx;                                                         \
   10.52 -        pushl %ebx;
   10.53 -
   10.54 -#define HVM_RESTORE_ALL_NOSEGREGS               \
   10.55 -        popl %ebx;                              \
   10.56 -        popl %ecx;                              \
   10.57 -        popl %edx;                              \
   10.58 -        popl %esi;                              \
   10.59 -        popl %edi;                              \
   10.60 -        popl %ebp;                              \
   10.61 -        popl %eax
   10.62 -
   10.63 -        ALIGN
   10.64 -.globl vmx_asm_vmexit_handler
   10.65 -vmx_asm_vmexit_handler:
   10.66 -        HVM_SAVE_ALL_NOSEGREGS
   10.67 -        GET_CURRENT(%ebx)
   10.68 -
   10.69 -        movb $1,VCPU_vmx_launched(%ebx)
   10.70 -
   10.71 -        movl $GUEST_RIP,%eax
   10.72 -        VMREAD(UREGS_eip)
   10.73 -        movl $GUEST_RSP,%eax
   10.74 -        VMREAD(UREGS_esp)
   10.75 -        movl $GUEST_RFLAGS,%eax
   10.76 -        VMREAD(UREGS_eflags)
   10.77 -
   10.78 -        movl %cr2,%eax
   10.79 -        movl %eax,VCPU_hvm_guest_cr2(%ebx)
   10.80 -
   10.81 -#ifndef NDEBUG
   10.82 -        movw $0xbeef,%ax
   10.83 -        movw %ax,UREGS_error_code(%esp)
   10.84 -        movw %ax,UREGS_entry_vector(%esp)
   10.85 -        movw %ax,UREGS_saved_upcall_mask(%esp)
   10.86 -        movw %ax,UREGS_cs(%esp)
   10.87 -        movw %ax,UREGS_ds(%esp)
   10.88 -        movw %ax,UREGS_es(%esp)
   10.89 -        movw %ax,UREGS_fs(%esp)
   10.90 -        movw %ax,UREGS_gs(%esp)
   10.91 -        movw %ax,UREGS_ss(%esp)
   10.92 -#endif
   10.93 -
   10.94 -        movl %esp,%eax
   10.95 -        push %eax
   10.96 -        call vmx_vmexit_handler
   10.97 -        addl $4,%esp
   10.98 -
   10.99 -.globl vmx_asm_do_vmentry
  10.100 -vmx_asm_do_vmentry:
  10.101 -        GET_CURRENT(%ebx)
  10.102 -        cli                             # tests must not race interrupts
  10.103 -
  10.104 -        movl VCPU_processor(%ebx),%eax
  10.105 -        shl  $IRQSTAT_shift,%eax
  10.106 -        cmpl $0,irq_stat(%eax,1)
  10.107 -        jnz  .Lvmx_process_softirqs
  10.108 -
  10.109 -        call vmx_intr_assist
  10.110 -
  10.111 -        testb $0xff,VCPU_vmx_emul(%ebx)
  10.112 -        jnz  .Lvmx_goto_realmode
  10.113 -
  10.114 -        movl VCPU_hvm_guest_cr2(%ebx),%eax
  10.115 -        movl %eax,%cr2
  10.116 -        call vmx_trace_vmentry
  10.117 -
  10.118 -        movl $GUEST_RIP,%eax
  10.119 -        VMWRITE(UREGS_eip)
  10.120 -        movl $GUEST_RSP,%eax
  10.121 -        VMWRITE(UREGS_esp)
  10.122 -        movl $GUEST_RFLAGS,%eax
  10.123 -        VMWRITE(UREGS_eflags)
  10.124 -
  10.125 -        cmpb $0,VCPU_vmx_launched(%ebx)
  10.126 -        HVM_RESTORE_ALL_NOSEGREGS
  10.127 -        je   .Lvmx_launch
  10.128 -
  10.129 -/*.Lvmx_resume:*/
  10.130 -        VMRESUME
  10.131 -        call vm_resume_fail
  10.132 -        ud2
  10.133 -
  10.134 -.Lvmx_launch:
  10.135 -        VMLAUNCH
  10.136 -        call vm_launch_fail
  10.137 -        ud2
  10.138 -
  10.139 -.Lvmx_goto_realmode:
  10.140 -        sti
  10.141 -        movl %esp,%eax
  10.142 -        push %eax
  10.143 -        call vmx_realmode
  10.144 -        addl $4,%esp
  10.145 -        jmp vmx_asm_do_vmentry
  10.146 -
  10.147 -.Lvmx_process_softirqs:
  10.148 -        sti
  10.149 -        call do_softirq
  10.150 -        jmp vmx_asm_do_vmentry
    11.1 --- a/xen/arch/x86/hvm/vmx/x86_64/Makefile	Mon Apr 21 12:23:55 2008 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,1 +0,0 @@
    11.4 -obj-y += exits.o
    12.1 --- a/xen/arch/x86/hvm/vmx/x86_64/exits.S	Mon Apr 21 12:23:55 2008 +0100
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,165 +0,0 @@
    12.4 -/*
    12.5 - * exits.S: VMX architecture-specific exit handling.
    12.6 - * Copyright (c) 2004, Intel Corporation.
    12.7 - *
    12.8 - * This program is free software; you can redistribute it and/or modify it
    12.9 - * under the terms and conditions of the GNU General Public License,
   12.10 - * version 2, as published by the Free Software Foundation.
   12.11 - *
   12.12 - * This program is distributed in the hope it will be useful, but WITHOUT
   12.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   12.15 - * more details.
   12.16 - *
   12.17 - * You should have received a copy of the GNU General Public License along with
   12.18 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   12.19 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   12.20 - */
   12.21 -#include <xen/config.h>
   12.22 -#include <xen/errno.h>
   12.23 -#include <xen/softirq.h>
   12.24 -#include <asm/asm_defns.h>
   12.25 -#include <asm/apicdef.h>
   12.26 -#include <asm/page.h>
   12.27 -#include <public/xen.h>
   12.28 -
   12.29 -#define VMRESUME     .byte 0x0f,0x01,0xc3
   12.30 -#define VMLAUNCH     .byte 0x0f,0x01,0xc2
   12.31 -#define VMREAD(off)  .byte 0x0f,0x78,0x47,((off)-UREGS_rip)
   12.32 -#define VMWRITE(off) .byte 0x0f,0x79,0x47,((off)-UREGS_rip)
   12.33 -
   12.34 -/* VMCS field encodings */
   12.35 -#define GUEST_RSP    0x681c
   12.36 -#define GUEST_RIP    0x681e
   12.37 -#define GUEST_RFLAGS 0x6820
   12.38 -
   12.39 -#define GET_CURRENT(reg)         \
   12.40 -        movq $STACK_SIZE-8, reg; \
   12.41 -        orq  %rsp, reg;          \
   12.42 -        andq $~7,reg;            \
   12.43 -        movq (reg),reg;
   12.44 -
   12.45 -#define HVM_SAVE_ALL_NOSEGREGS                  \
   12.46 -        pushq %rdi;                             \
   12.47 -        pushq %rsi;                             \
   12.48 -        pushq %rdx;                             \
   12.49 -        pushq %rcx;                             \
   12.50 -        pushq %rax;                             \
   12.51 -        pushq %r8;                              \
   12.52 -        pushq %r9;                              \
   12.53 -        pushq %r10;                             \
   12.54 -        pushq %r11;                             \
   12.55 -        pushq %rbx;                             \
   12.56 -        pushq %rbp;                             \
   12.57 -        pushq %r12;                             \
   12.58 -        pushq %r13;                             \
   12.59 -        pushq %r14;                             \
   12.60 -        pushq %r15;
   12.61 -
   12.62 -#define HVM_RESTORE_ALL_NOSEGREGS               \
   12.63 -        popq %r15;                              \
   12.64 -        popq %r14;                              \
   12.65 -        popq %r13;                              \
   12.66 -        popq %r12;                              \
   12.67 -        popq %rbp;                              \
   12.68 -        popq %rbx;                              \
   12.69 -        popq %r11;                              \
   12.70 -        popq %r10;                              \
   12.71 -        popq %r9;                               \
   12.72 -        popq %r8;                               \
   12.73 -        popq %rax;                              \
   12.74 -        popq %rcx;                              \
   12.75 -        popq %rdx;                              \
   12.76 -        popq %rsi;                              \
   12.77 -        popq %rdi
   12.78 -
   12.79 -        ALIGN
   12.80 -.globl vmx_asm_vmexit_handler
   12.81 -vmx_asm_vmexit_handler:
   12.82 -        HVM_SAVE_ALL_NOSEGREGS
   12.83 -        GET_CURRENT(%rbx)
   12.84 -
   12.85 -        movb $1,VCPU_vmx_launched(%rbx)
   12.86 -
   12.87 -        leaq UREGS_rip(%rsp),%rdi
   12.88 -        movl $GUEST_RIP,%eax
   12.89 -        /*VMREAD(UREGS_rip)*/
   12.90 -        .byte 0x0f,0x78,0x07  /* vmread %rax,(%rdi) */
   12.91 -        movl $GUEST_RSP,%eax
   12.92 -        VMREAD(UREGS_rsp)
   12.93 -        movl $GUEST_RFLAGS,%eax
   12.94 -        VMREAD(UREGS_eflags)
   12.95 -
   12.96 -        movq %cr2,%rax
   12.97 -        movq %rax,VCPU_hvm_guest_cr2(%rbx)
   12.98 -
   12.99 -#ifndef NDEBUG
  12.100 -        movw $0xbeef,%ax
  12.101 -        movw %ax,UREGS_error_code(%rsp)
  12.102 -        movw %ax,UREGS_entry_vector(%rsp)
  12.103 -        movw %ax,UREGS_saved_upcall_mask(%rsp)
  12.104 -        movw %ax,UREGS_cs(%rsp)
  12.105 -        movw %ax,UREGS_ds(%rsp)
  12.106 -        movw %ax,UREGS_es(%rsp)
  12.107 -        movw %ax,UREGS_fs(%rsp)
  12.108 -        movw %ax,UREGS_gs(%rsp)
  12.109 -        movw %ax,UREGS_ss(%rsp)
  12.110 -#endif
  12.111 -
  12.112 -        movq %rsp,%rdi
  12.113 -        call vmx_vmexit_handler
  12.114 -
  12.115 -.globl vmx_asm_do_vmentry
  12.116 -vmx_asm_do_vmentry:
  12.117 -        GET_CURRENT(%rbx)
  12.118 -        cli                             # tests must not race interrupts
  12.119 -
  12.120 -        movl  VCPU_processor(%rbx),%eax
  12.121 -        shl   $IRQSTAT_shift,%rax
  12.122 -        leaq  irq_stat(%rip),%rdx
  12.123 -        cmpl  $0,(%rdx,%rax,1)
  12.124 -        jnz   .Lvmx_process_softirqs
  12.125 -
  12.126 -        call vmx_intr_assist
  12.127 -
  12.128 -        testb $0xff,VCPU_vmx_emul(%rbx)
  12.129 -        jnz  .Lvmx_goto_realmode
  12.130 -
  12.131 -        movq VCPU_hvm_guest_cr2(%rbx),%rax
  12.132 -        movq %rax,%cr2
  12.133 -        call vmx_trace_vmentry
  12.134 -
  12.135 -        leaq UREGS_rip(%rsp),%rdi
  12.136 -        movl $GUEST_RIP,%eax
  12.137 -        /*VMWRITE(UREGS_rip)*/
  12.138 -        .byte 0x0f,0x79,0x07  /* vmwrite (%rdi),%rax */
  12.139 -        movl $GUEST_RSP,%eax
  12.140 -        VMWRITE(UREGS_rsp)
  12.141 -        movl $GUEST_RFLAGS,%eax
  12.142 -        VMWRITE(UREGS_eflags)
  12.143 -
  12.144 -        cmpb $0,VCPU_vmx_launched(%rbx)
  12.145 -        HVM_RESTORE_ALL_NOSEGREGS
  12.146 -        je   .Lvmx_launch
  12.147 -
  12.148 -/*.Lvmx_resume:*/
  12.149 -        VMRESUME
  12.150 -        call vm_resume_fail
  12.151 -        ud2
  12.152 -
  12.153 -.Lvmx_launch:
  12.154 -        VMLAUNCH
  12.155 -        call vm_launch_fail
  12.156 -        ud2
  12.157 -
  12.158 -.Lvmx_goto_realmode:
  12.159 -        sti
  12.160 -        movq %rsp,%rdi
  12.161 -        call vmx_realmode
  12.162 -        jmp vmx_asm_do_vmentry
  12.163 -        jmp vmx_asm_do_vmentry
  12.164 -
  12.165 -.Lvmx_process_softirqs:
  12.166 -        sti
  12.167 -        call do_softirq
  12.168 -        jmp vmx_asm_do_vmentry