Skip to contentSkip to conversation

add 32-bit checkpoint wrapper

PATCH In review Serge E. Hallyn 2 participants 2 messages Jan 18, 2010 – Jan 20, 2010 1 message not in the archive x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add 32-bit checkpoint wrapper

and get logfd from the right register (di is 5th arg)

With this patch on top of Oren's dec 6 patches, and my own patch from earlier today, cr_tests pass on x86-32.

I will probably push these to cr-next tomorrow along with the needed accompanying s390 and powerpc (from Nathan) changes.

---
 arch/x86/kernel/checkpoint_32.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
arch/x86/kernel/checkpoint_32.c +19 -1
index d5ea6a0..3ce9a81 100644
@@ -19,6 +19,24 @@
 #include <linux/checkpoint_hdr.h>
 
 /*
+ * sys_checkpoint needs to be a ptregscall if sys_restart is
+ * one so self-checkpoint images can be restarted.
+ */
+long sys_checkpoint(struct pt_regs *regs)
+{
+	unsigned long flags;
+	int fd, logfd;
+	pid_t pid;
+
+	pid = regs->bx;
+	fd = regs->cx;
+	flags = regs->dx;
+	logfd = regs->si;
+
+	return do_sys_checkpoint(pid, fd, flags, logfd);
+}
+
+/*
  * sys_restart needs to access and modify the pt_regs structure to
  * restore the original state from the time of the checkpoint.
  */
@@ -31,7 +49,7 @@ long sys_restart(struct pt_regs *regs)
 	pid = regs->bx;
 	fd = regs->cx;
 	flags = regs->dx;
-	logfd = regs->di;
+	logfd = regs->si;
 
 	return do_sys_restart(pid, fd, flags, logfd);
 }
Signature · 1 line
1.6.0.4

A message that is not in the archive (sent off-list or not yet received): 20100118232245.GA31116-r/[email protected]

#2 lore raw

This one too.

Quoted 51 lines · Serge E. Hallyn

and get logfd from the right register (di is 5th arg)

With this patch on top of Oren's dec 6 patches, and my own patch from earlier today, cr_tests pass on x86-32.

I will probably push these to cr-next tomorrow along with the needed accompanying s390 and powerpc (from Nathan) changes.

---
 arch/x86/kernel/checkpoint_32.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
arch/x86/kernel/checkpoint_32.c +19 -1
index d5ea6a0..3ce9a81 100644
@@ -19,6 +19,24 @@
 #include <linux/checkpoint_hdr.h>
 
 /*
+ * sys_checkpoint needs to be a ptregscall if sys_restart is
+ * one so self-checkpoint images can be restarted.
+ */
+long sys_checkpoint(struct pt_regs *regs)
+{
+	unsigned long flags;
+	int fd, logfd;
+	pid_t pid;
+
+	pid = regs->bx;
+	fd = regs->cx;
+	flags = regs->dx;
+	logfd = regs->si;
+
+	return do_sys_checkpoint(pid, fd, flags, logfd);
+}
+
+/*
  * sys_restart needs to access and modify the pt_regs structure to
  * restore the original state from the time of the checkpoint.
  */
@@ -31,7 +49,7 @@ long sys_restart(struct pt_regs *regs)
 	pid = regs->bx;
 	fd = regs->cx;
 	flags = regs->dx;
-	logfd = regs->di;
+	logfd = regs->si;
 
 	return do_sys_restart(pid, fd, flags, logfd);
 }