[PATCH 1/1] cr: s390: set return value for self-checkpoint

Serge E. Hallyn serue at us.ibm.com
Thu Jul 23 11:21:25 PDT 2009


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 at us.ibm.com>
---
 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



More information about the Containers mailing list