aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/paravirt.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-06-25 00:19:28 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 07:15:52 -0400
commit2be29982a08009c731307f4a39053b70ac4700da (patch)
treef01fcf847f36b9da5cd87cefa7ee6c13d193077d /arch/x86/kernel/paravirt.c
parentc7245da6ae7e5208504ff027c4e0eec69b788651 (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/kernel/paravirt.c')
-rw-r--r--arch/x86/kernel/paravirt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index b0b17f0bc7e9..bf1067e89cad 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -141,7 +141,8 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
141 ret = paravirt_patch_nop(); 141 ret = paravirt_patch_nop();
142 else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) || 142 else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
143 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) || 143 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
144 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret)) 144 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret32) ||
145 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret64))
145 /* If operation requires a jmp, then jmp */ 146 /* If operation requires a jmp, then jmp */
146 ret = paravirt_patch_jmp(insnbuf, opfunc, addr, len); 147 ret = paravirt_patch_jmp(insnbuf, opfunc, addr, len);
147 else 148 else
@@ -193,7 +194,8 @@ static void native_flush_tlb_single(unsigned long addr)
193/* These are in entry.S */ 194/* These are in entry.S */
194extern void native_iret(void); 195extern void native_iret(void);
195extern void native_irq_enable_sysexit(void); 196extern void native_irq_enable_sysexit(void);
196extern void native_usergs_sysret(void); 197extern void native_usergs_sysret32(void);
198extern void native_usergs_sysret64(void);
197 199
198static int __init print_banner(void) 200static int __init print_banner(void)
199{ 201{
@@ -329,10 +331,10 @@ struct pv_cpu_ops pv_cpu_ops = {
329 .write_idt_entry = native_write_idt_entry, 331 .write_idt_entry = native_write_idt_entry,
330 .load_sp0 = native_load_sp0, 332 .load_sp0 = native_load_sp0,
331 333
332#ifdef CONFIG_X86_32
333 .irq_enable_sysexit = native_irq_enable_sysexit, 334 .irq_enable_sysexit = native_irq_enable_sysexit,
334#else 335#ifdef CONFIG_X86_64
335 .usergs_sysret = native_usergs_sysret, 336 .usergs_sysret32 = native_usergs_sysret32,
337 .usergs_sysret64 = native_usergs_sysret64,
336#endif 338#endif
337 .iret = native_iret, 339 .iret = native_iret,
338 .swapgs = native_swapgs, 340 .swapgs = native_swapgs,