Linux Container Development
 help / color / mirror / Atom feed
* [PATCH 1/1] cr: s390: set return value for self-checkpoint
@ 2009-07-23 18:21 Serge E. Hallyn
       [not found] ` <20090723182125.GA18383-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Serge E. Hallyn @ 2009-07-23 18:21 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

If doing a self-checkpoint, then optimistically store 0 as the
syscall return value to indicate success.

This was being done for x86, but not yet being done for s390.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 arch/s390/mm/checkpoint.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/s390/mm/checkpoint.c b/arch/s390/mm/checkpoint.c
index a4a5da9..40dd417 100644
--- a/arch/s390/mm/checkpoint.c
+++ b/arch/s390/mm/checkpoint.c
@@ -54,6 +54,17 @@ static void s390_copy_regs(int op, struct ckpt_hdr_cpu *h,
 	CKPT_COPY(op, h->instruction_fetch, thr->per_info.instruction_fetch);
 
 	CKPT_COPY_ARRAY(op, h->gprs, regs->gprs, NUM_GPRS);
+	/*
+	 * for checkpoint in process context (from within a container),
+	 * the actual syscall is taking place at this very moment; so
+	 * we (optimistically) subtitute the future return value (0) of
+	 * this syscall into the orig_eax, so that upon restart it will
+	 * succeed (or it will endlessly retry checkpoint...)
+	 */
+	if (op == CKPT_CPT && t==current) {
+		BUG_ON(h->gprs[2] < 0);
+		h->gprs[2] = 0;
+	}
 	CKPT_COPY_ARRAY(op, h->fprs, thr->fp_regs.fprs, NUM_FPRS);
 	CKPT_COPY_ARRAY(op, h->acrs, thr->acrs, NUM_ACRS);
 	CKPT_COPY_ARRAY(op, h->per_control_regs,
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-24  1:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 18:21 [PATCH 1/1] cr: s390: set return value for self-checkpoint Serge E. Hallyn
     [not found] ` <20090723182125.GA18383-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-07-24  1:47   ` Oren Laadan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox