Merged some code from criu-dev into master

Submitted by Laurent Dufour on Sept. 7, 2016, 11:23 a.m.

Details

Message ID 25a7bf23-0c3d-22df-6f02-6885f0aa70e6@linux.vnet.ibm.com
State Rejected
Series "Merged some code from criu-dev into master"
Headers show

Commit Message

Laurent Dufour Sept. 7, 2016, 11:23 a.m.
On 06/09/2016 18:38, Pavel Emelyanov wrote:
> Hello,
> 
> I've pulled some features that seem to work in criu-dev into master branch.
> 
> Eugene, the code for shmem changes tracking conflicted with the lack of
> lazy pages in master :) Would you please, check that I resolved it correctly.
> 
> Dima, Laurent, the PMEM patches depended on c220f6da (sigframe: prepare macro 
> helpers for two sigframes) which in turn sat in the x32 set, so I ported one
> too. Would you also please check that I didn't break things.

Pavel,

I figured out what is going wrong here.

When porting the commit c220f6da (sigframe: prepare macro helpers for
two sigframes), the call to restore_gpregs() in construct_sigframe() has
been moved back to end of the function. So it is now called after
sigreturn_prep_fpu_frame().

I applied the attached patch which move the call back to the beginning
of the service as done in the original patch on criu-dev.
I was able to run succesfully all the tests for ppc64 (except maps008
which is still broken, and mnt_tracefs which is failing due to debugfs
mount point), and some basic TM tests as well.

Cheers,
Laurent.

Patch hide | download patch | download mbox

From 069b7aa8071ea892226a6bc80d2e90ef131abbbc Mon Sep 17 00:00:00 2001
From: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Date: Wed, 7 Sep 2016 13:10:42 +0200
Subject: [PATCH 1/1] Fixing commit c220f6da

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
---
 criu/sigframe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/criu/sigframe.c b/criu/sigframe.c
index 72eaee965ecf..376e4dd9d53e 100644
--- a/criu/sigframe.c
+++ b/criu/sigframe.c
@@ -27,6 +27,9 @@  int construct_sigframe(struct rt_sigframe *sigframe,
 {
 	k_rtsigset_t *blk_sigset = RT_SIGFRAME_UC_SIGMASK(sigframe);
 
+	if (restore_gpregs(sigframe, CORE_THREAD_ARCH_INFO(core)->gpregs))
+		return -1;
+
 	if (core->tc)
 		memcpy(blk_sigset, &core->tc->blk_sigset, sizeof(k_rtsigset_t));
 	else if (core->thread_core->has_blk_sigset) {
@@ -42,9 +45,6 @@  int construct_sigframe(struct rt_sigframe *sigframe,
 		if (sigreturn_prep_fpu_frame(sigframe, rsigframe))
 			return -1;
 
-	if (restore_gpregs(sigframe, CORE_THREAD_ARCH_INFO(core)->gpregs))
-		return -1;
-
 	setup_sas(sigframe, core->thread_core->sas);
 
 	return 0;
-- 
2.7.4


Comments

Dmitry Safonov Sept. 7, 2016, 11:45 a.m.
On 09/07/2016 02:23 PM, Laurent Dufour wrote:
> On 06/09/2016 18:38, Pavel Emelyanov wrote:
>> Hello,
>>
>> I've pulled some features that seem to work in criu-dev into master branch.
>>
>> Eugene, the code for shmem changes tracking conflicted with the lack of
>> lazy pages in master :) Would you please, check that I resolved it correctly.
>>
>> Dima, Laurent, the PMEM patches depended on c220f6da (sigframe: prepare macro
>> helpers for two sigframes) which in turn sat in the x32 set, so I ported one
>> too. Would you also please check that I didn't break things.
>
> Pavel,

Hi Laurent,

> I figured out what is going wrong here.
>
> When porting the commit c220f6da (sigframe: prepare macro helpers for
> two sigframes), the call to restore_gpregs() in construct_sigframe() has
> been moved back to end of the function. So it is now called after
> sigreturn_prep_fpu_frame().
>
> I applied the attached patch which move the call back to the beginning
> of the service as done in the original patch on criu-dev.
> I was able to run succesfully all the tests for ppc64 (except maps008
> which is still broken, and mnt_tracefs which is failing due to debugfs
> mount point), and some basic TM tests as well.

Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>

Thanks for the patch, it looks like it was part of commit 1c249d08870b
("x86: add 32-bit sigframe for rt_sigreturn") from criu-dev.
When I've prepared the patches set, I've tested patches separately from
the set on x86, but hadn't possibility to test them separately on ppc.
And for x86 it didn't matter when to call restore_gpregs() before compat
patches, so I didn't catch that it does matter for ppc.

Thanks,
              Dmitry
Pavel Emelianov Sept. 7, 2016, 2:08 p.m.
On 09/07/2016 02:23 PM, Laurent Dufour wrote:
> On 06/09/2016 18:38, Pavel Emelyanov wrote:
>> Hello,
>>
>> I've pulled some features that seem to work in criu-dev into master branch.
>>
>> Eugene, the code for shmem changes tracking conflicted with the lack of
>> lazy pages in master :) Would you please, check that I resolved it correctly.
>>
>> Dima, Laurent, the PMEM patches depended on c220f6da (sigframe: prepare macro 
>> helpers for two sigframes) which in turn sat in the x32 set, so I ported one
>> too. Would you also please check that I didn't break things.
> 
> Pavel,
> 
> I figured out what is going wrong here.
> 
> When porting the commit c220f6da (sigframe: prepare macro helpers for
> two sigframes), the call to restore_gpregs() in construct_sigframe() has
> been moved back to end of the function. So it is now called after
> sigreturn_prep_fpu_frame().
> 
> I applied the attached patch which move the call back to the beginning
> of the service as done in the original patch on criu-dev.
> I was able to run succesfully all the tests for ppc64 (except maps008
> which is still broken, and mnt_tracefs which is failing due to debugfs
> mount point), and some basic TM tests as well.

Applied to master :) Thanks A LOT, Laurent!

-- Pavel