From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: [PATCH 1/1] cr: s390: set return value for self-checkpoint Date: Thu, 23 Jul 2009 13:21:25 -0500 Message-ID: <20090723182125.GA18383@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: Linux Containers List-Id: containers.vger.kernel.org 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 --- 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