[CRIU] [PATCH] pie: fix clobber registers for int 0x80

Dmitry Safonov dsafonov at virtuozzo.com
Wed Dec 14 07:40:49 PST 2016


I managed to forgot that kernel erases R8...R11 regitster
prior returning to userspace from `int 0x80`:
https://lkml.org/lkml/2009/10/1/164

That was the reason for hang on gcc v6.1 on Jenkins/elsewhere:
https://ci.openvz.org/job/CRIU/job/CRIU-x86_64/branch/criu-dev/

I'll check the other places with `int 0x80` for missed clobbers.

Tested on gcc v6.1 locally, on Travis-CI:
https://travis-ci.org/0x7f454c46/criu/builds/183958805

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/arch/x86/include/asm/parasite.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/criu/arch/x86/include/asm/parasite.h b/criu/arch/x86/include/asm/parasite.h
index 2385ec16d061..7b259d7a2c8d 100644
--- a/criu/arch/x86/include/asm/parasite.h
+++ b/criu/arch/x86/include/asm/parasite.h
@@ -38,12 +38,8 @@ static int arch_get_user_desc(user_desc_t *desc)
 	"	mov %%eax,%0			\n"
 	: "+m"(ret)
 	: "m"(desc)
-	: "eax", "rbx", "memory");
+	: "rax", "rbx", "r8", "r9", "r10", "r11", "memory");
 
-	/*
-	 * Fixup for Travis: on missing GDT entry get_thread_area()
-	 * retruns -EINTR then descriptor with seg_not_preset = 1
-	 */
 	if (ret)
 		pr_err("Failed to dump TLS descriptor #%d: %d\n",
 				desc->entry_number, ret);
-- 
2.10.2



More information about the CRIU mailing list