* [PATCH linux-cr] x86-32 and ia32 eclone, checkpoint, restart fixes
@ 2010-01-23 0:34 Serge E. Hallyn
[not found] ` <20100123003447.GA5285-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Serge E. Hallyn @ 2010-01-23 0:34 UTC (permalink / raw)
To: Oren Laadan; +Cc: Linux Containers
Eclone on x86-32 should use esi for 4th arg (upids), not
edi, which is 5th arg. This will require a corresponding fix
to user-cr, but (a) it's correct and (b) it's required so that
IA32_ARG_FIXUP can put upids in the right register for
process_64.c:sys_eclone(). IA32_ARG_FIXUP will (of course) put
edi into r8, the 5th arg.
Add the ptregs_syscall stubs for eclone, checkpoint, and restart
for 32-bit api on x86-64.
With this patch (and proper user-cr), checkpoint and eclone work
on x86-32, x86-64, and in 32-bit mode on x86-64. (restart has not
yet been tested)
Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
arch/x86/ia32/ia32entry.S | 11 +++++++++++
arch/x86/kernel/process_32.c | 2 +-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 581b056..67bf4dc 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -477,6 +477,14 @@ quiet_ni_syscall:
PTREGSCALL stub32_clone, sys32_clone, %rdx
PTREGSCALL stub32_vfork, sys_vfork, %rdi
PTREGSCALL stub32_iopl, sys_iopl, %rsi
+ PTREGSCALL stub32_eclone, sys_eclone, %r8
+#ifdef CONFIG_CHECKPOINT
+ PTREGSCALL stub32_checkpoint, sys_checkpoint, %r8
+ PTREGSCALL stub32_restart, sys_restart, %r8
+#else
+ PTREGSCALL stub32_checkpoint, sys_ni_syscall, %r8
+ PTREGSCALL stub32_restart, sys_ni_syscall, %r8
+#endif
ENTRY(ia32_ptregs_common)
popq %r11
@@ -841,4 +849,7 @@ ia32_sys_call_table:
.quad compat_sys_pwritev
.quad compat_sys_rt_tgsigqueueinfo /* 335 */
.quad sys_perf_event_open
+ .quad stub32_eclone
+ .quad stub32_checkpoint
+ .quad stub32_restart
ia32_syscall_end:
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index ed8b53c..2416b62 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -455,7 +455,7 @@ int sys_eclone(struct pt_regs *regs)
flags_low = regs->bx;
uca = (struct clone_args __user *)regs->cx;
args_size = regs->dx;
- pids = (pid_t __user *)regs->di;
+ pids = (pid_t __user *)regs->si;
return do_eclone_common(regs, flags_low, uca, args_size, pids);
}
--
1.6.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-cr] x86-32 and ia32 eclone, checkpoint, restart fixes
[not found] ` <20100123003447.GA5285-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2010-01-23 2:38 ` Sukadev Bhattiprolu
0 siblings, 0 replies; 2+ messages in thread
From: Sukadev Bhattiprolu @ 2010-01-23 2:38 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: Linux Containers
Serge E. Hallyn [serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org] wrote:
| Eclone on x86-32 should use esi for 4th arg (upids), not
| edi, which is 5th arg. This will require a corresponding fix
Good catch and nice debug.
| to user-cr, but (a) it's correct and (b) it's required so that
| IA32_ARG_FIXUP can put upids in the right register for
| process_64.c:sys_eclone(). IA32_ARG_FIXUP will (of course) put
| edi into r8, the 5th arg.
|
| Add the ptregs_syscall stubs for eclone, checkpoint, and restart
| for 32-bit api on x86-64.
|
| With this patch (and proper user-cr), checkpoint and eclone work
| on x86-32, x86-64, and in 32-bit mode on x86-64. (restart has not
| yet been tested)
|
| Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-23 2:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-23 0:34 [PATCH linux-cr] x86-32 and ia32 eclone, checkpoint, restart fixes Serge E. Hallyn
[not found] ` <20100123003447.GA5285-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-01-23 2:38 ` Sukadev Bhattiprolu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.