diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-03-17 19:37:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:31 -0400 |
commit | e2a81baf6604a2e08e10c7405b0349106f77c8af (patch) | |
tree | 3eaf386316be1f499d92fae213493ec3d6b5b576 /arch/x86/kernel/entry_32.S | |
parent | aa380c82b83252754a8c11bfc92359bd87cbf710 (diff) |
xen: support sysenter/sysexit if hypervisor does
64-bit Xen supports sysenter for 32-bit guests, so support its
use. (sysenter is faster than int $0x80 in 32-on-64.)
sysexit is still not supported, so we fake it up using iret.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r-- | arch/x86/kernel/entry_32.S | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 568c6ccd7ae..5d80d53eaff 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1017,6 +1017,13 @@ ENTRY(kernel_thread_helper) | |||
1017 | ENDPROC(kernel_thread_helper) | 1017 | ENDPROC(kernel_thread_helper) |
1018 | 1018 | ||
1019 | #ifdef CONFIG_XEN | 1019 | #ifdef CONFIG_XEN |
1020 | /* Xen doesn't set %esp to be precisely what the normal sysenter | ||
1021 | entrypoint expects, so fix it up before using the normal path. */ | ||
1022 | ENTRY(xen_sysenter_target) | ||
1023 | RING0_INT_FRAME | ||
1024 | addl $5*4, %esp /* remove xen-provided frame */ | ||
1025 | jmp sysenter_past_esp | ||
1026 | |||
1020 | ENTRY(xen_hypervisor_callback) | 1027 | ENTRY(xen_hypervisor_callback) |
1021 | CFI_STARTPROC | 1028 | CFI_STARTPROC |
1022 | pushl $0 | 1029 | pushl $0 |
@@ -1036,8 +1043,17 @@ ENTRY(xen_hypervisor_callback) | |||
1036 | jae 1f | 1043 | jae 1f |
1037 | 1044 | ||
1038 | call xen_iret_crit_fixup | 1045 | call xen_iret_crit_fixup |
1046 | jmp 2f | ||
1047 | |||
1048 | 1: cmpl $xen_sysexit_start_crit,%eax | ||
1049 | jb 2f | ||
1050 | cmpl $xen_sysexit_end_crit,%eax | ||
1051 | jae 2f | ||
1052 | |||
1053 | jmp xen_sysexit_crit_fixup | ||
1039 | 1054 | ||
1040 | 1: mov %esp, %eax | 1055 | ENTRY(xen_do_upcall) |
1056 | 2: mov %esp, %eax | ||
1041 | call xen_evtchn_do_upcall | 1057 | call xen_evtchn_do_upcall |
1042 | jmp ret_from_intr | 1058 | jmp ret_from_intr |
1043 | CFI_ENDPROC | 1059 | CFI_ENDPROC |