diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-06-25 00:19:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 07:15:52 -0400 |
commit | 2be29982a08009c731307f4a39053b70ac4700da (patch) | |
tree | f01fcf847f36b9da5cd87cefa7ee6c13d193077d /arch/x86/ia32/ia32entry.S | |
parent | c7245da6ae7e5208504ff027c4e0eec69b788651 (diff) |
x86/paravirt: add sysret/sysexit pvops for returning to 32-bit compatibility userspace
In a 64-bit system, we need separate sysret/sysexit operations to
return to a 32-bit userspace.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citirx.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/ia32/ia32entry.S')
-rw-r--r-- | arch/x86/ia32/ia32entry.S | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 3aefbce2de48..2a4c42427d9a 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -61,6 +61,19 @@ | |||
61 | CFI_UNDEFINED r15 | 61 | CFI_UNDEFINED r15 |
62 | .endm | 62 | .endm |
63 | 63 | ||
64 | #ifdef CONFIG_PARAVIRT | ||
65 | ENTRY(native_usergs_sysret32) | ||
66 | swapgs | ||
67 | sysretl | ||
68 | ENDPROC(native_usergs_sysret32) | ||
69 | |||
70 | ENTRY(native_irq_enable_sysexit) | ||
71 | swapgs | ||
72 | sti | ||
73 | sysexit | ||
74 | ENDPROC(native_irq_enable_sysexit) | ||
75 | #endif | ||
76 | |||
64 | /* | 77 | /* |
65 | * 32bit SYSENTER instruction entry. | 78 | * 32bit SYSENTER instruction entry. |
66 | * | 79 | * |
@@ -151,10 +164,7 @@ sysenter_do_call: | |||
151 | CFI_ADJUST_CFA_OFFSET -8 | 164 | CFI_ADJUST_CFA_OFFSET -8 |
152 | CFI_REGISTER rsp,rcx | 165 | CFI_REGISTER rsp,rcx |
153 | TRACE_IRQS_ON | 166 | TRACE_IRQS_ON |
154 | swapgs | 167 | ENABLE_INTERRUPTS_SYSEXIT32 |
155 | sti /* sti only takes effect after the next instruction */ | ||
156 | /* sysexit */ | ||
157 | .byte 0xf, 0x35 | ||
158 | 168 | ||
159 | sysenter_tracesys: | 169 | sysenter_tracesys: |
160 | CFI_RESTORE_STATE | 170 | CFI_RESTORE_STATE |
@@ -254,8 +264,7 @@ cstar_do_call: | |||
254 | TRACE_IRQS_ON | 264 | TRACE_IRQS_ON |
255 | movl RSP-ARGOFFSET(%rsp),%esp | 265 | movl RSP-ARGOFFSET(%rsp),%esp |
256 | CFI_RESTORE rsp | 266 | CFI_RESTORE rsp |
257 | swapgs | 267 | USERGS_SYSRET32 |
258 | sysretl | ||
259 | 268 | ||
260 | cstar_tracesys: | 269 | cstar_tracesys: |
261 | CFI_RESTORE_STATE | 270 | CFI_RESTORE_STATE |