[CRIU] [PATCHv1 24/26] x86/call32: reserve space for saving 64-bit sp on 32-bit stack

Dmitry Safonov dsafonov at virtuozzo.com
Thu Jun 16 03:53:41 PDT 2016


I prefer this to be done in callee, than in caller for simplicity.

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/arch/x86/call32.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/criu/arch/x86/call32.S b/criu/arch/x86/call32.S
index f2e118f266f1..bc724d6c5fae 100644
--- a/criu/arch/x86/call32.S
+++ b/criu/arch/x86/call32.S
@@ -34,6 +34,7 @@ call32_from_64:
 	pushfq
 
 	// Switch stacks
+	sub $8, %rdi
 	mov %rsp,(%rdi)
 	mov %rdi,%rsp
 
@@ -53,6 +54,7 @@ call32_from_64:
 1:
 	// Restore the stack
 	mov (%rsp),%rsp
+	add $8, %rdi
 
 	// Restore registers
 	popfq
-- 
2.8.3



More information about the CRIU mailing list