[Devel] Re: [PATCH 1/2] c/r: [x86_32] sys_restore to use ptregs prototype

Serge E. Hallyn serue at us.ibm.com
Wed Dec 9 08:52:47 PST 2009


Quoting Nathan Lynch (ntl at pobox.com):
> 
> > > * Changes the syscall prototype and definition to accept the pt_regs
> > >   struct as an argument (into %eax register).
> > 
> > I forgot to mention that this of course breaks s390 and ppc: you
> > need to provide an arch-dependent sys_restart() similar to how it's
> > done here.
> 
> Thanks, here's the fixup for powerpc.

Does this need to be in a #ifdef CONFIG_CHECKPOINT?

Near as I can tell there is no dummy do_sys_restart() for the
CONFIG_CHECKPOINT=n case.

> >From 981dca4f3a879827d6e19a0cf32c7fd25b08a878 Mon Sep 17 00:00:00 2001
> From: Nathan Lynch <ntl at pobox.com>
> Date: Mon, 7 Dec 2009 14:51:13 -0600
> Subject: [PATCH] checkpoint/powerpc: fix up restart code for ptregscall semantics
> 
> Signed-off-by: Nathan Lynch <ntl at pobox.com>
> ---
>  arch/powerpc/kernel/process.c |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index 457c269..f9da9eb 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -30,6 +30,7 @@
>  #include <linux/init_task.h>
>  #include <linux/module.h>
>  #include <linux/kallsyms.h>
> +#include <linux/checkpoint.h>
>  #include <linux/mqueue.h>
>  #include <linux/hardirq.h>
>  #include <linux/utsname.h>
> @@ -990,6 +991,25 @@ out:
>  	return error;
>  }
> 
> +int sys_restart(unsigned long a0, unsigned long a1, unsigned long a2,
> +	       unsigned long a3, unsigned long a4, unsigned long a5,
> +	       struct pt_regs *regs)
> +{
> +	unsigned long flags;
> +	pid_t pid;
> +	int logfd;
> +	int fd;
> +
> +	CHECK_FULL_REGS(regs);
> +
> +	pid = a0;
> +	fd = a1;
> +	flags = a2;
> +	logfd = a3;
> +
> +	return do_sys_restart(pid, fd, flags, logfd);
> +}
> +
>  #ifdef CONFIG_IRQSTACKS
>  static inline int valid_irq_stack(unsigned long sp, struct task_struct *p,
>  				  unsigned long nbytes)
> -- 
> 1.6.0.6
> 
> 
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list