cr: s390: set return value for self-checkpoint
PATCH 1/1 cr: s390: set return value for self-checkpoint
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/[email protected]>
--- arch/s390/mm/checkpoint.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/s390/mm/checkpoint.c +11 -0
@@ -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,
Signature · 1 line
1.6.1
A message that is not in the archive (sent off-list or not yet received): 20090723182125.GA18383-r/[email protected]
Got it, thanks.
Quoted 32 lines · Serge E. Hallyn
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/[email protected]>--- arch/s390/mm/checkpoint.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)arch/s390/mm/checkpoint.c +11
-0@@ -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,