[CRIU] [PATCH 0/2] x86: Parasite code preparation reworked

Cyrill Gorcunov gorcunov at gmail.com
Mon May 11 01:35:26 PDT 2015


On Mon, May 11, 2015 at 10:20:55AM +0200, Laurent Dufour wrote:
> On 08/05/2015 19:02, Cyrill Gorcunov wrote:
> > Hi guys, just wanna share early new approach for parasite (restorer)
> > code generation. As you know on x86-64 we're rather relying on linker
> > and rip addressing, moreover our parasite code doesnt have any
> > statically defined _structures_, only pointers and integer objects.
> > Because of that linker can easily resolve all relocations inplace
> > giving us plain bytestream of code ready to use.
> > 
> > This won't work for 32 bit code because we will need to apply relocations
> > manually once CRIU know where exactly to place parasite/restorer. So for
> > this sake I wrote a simple code generator which would create bytestreams
> > for us and all additional information needed to do run-time relocations
> > manually.
> > 
> > Please take a look, even in current form trivial tests are passed,
> > but I would love to hear feedback especially from ARM and PowerPC
> > camp (because I modifed Makefiles that way so arm/powerpc uses
> > old scheme).
> 
> Hi Cyrill,
> 

Ah, yeah. Fix
---
diff --git a/Makefile b/Makefile
index 59a579fd2e44..b29ced62d5a5 100644
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,9 @@ ARCH-LIB	:= $(ARCH_DIR)/crtools.built-in.o
 CRIU-SO		:= libcriu
 CRIU-LIB	:= lib/$(CRIU-SO).so
 CRIU-INC	:= lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto
+ifneq ($(filter i386 x86_64, $(ARCH)),)
 PIEGEN		:= pie/piegen/piegen
+endif
 
 export CC MAKE CFLAGS LIBS SRCARCH DEFINES MAKEFLAGS CRIU-SO
 export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD


More information about the CRIU mailing list