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

Laurent Dufour ldufour at linux.vnet.ibm.com
Mon May 11 01:20:55 PDT 2015


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,

FYI, I just started building your patch on the current head, and the
build is failing:
make[1]: Leaving directory '/local/laurent/work/criu'
make: Circular pie/piegen/piegen <- pie/piegen/piegen dependency dropped.
make[1]: Entering directory '/local/laurent/work/criu'
  DEP      arch/ppc64/restorer-trampoline.d
  DEP      arch/ppc64/restorer.d
  DEP      pie/restorer.d
  DEP      arch/ppc64/parasite-head.d
  DEP      pie/parasite.d
  DEP      arch/ppc64/vdso-trampoline.d
  DEP      arch/ppc64/vdso-pie.d
  DEP      pie/util-fd.d
  DEP      pie/util.d
  DEP      pie/log-simple.d
make[1]: *** No rule to make target 'pie/piegen/piegen'.  Stop.
make[1]: Leaving directory '/local/laurent/work/criu'
Makefile:200: recipe for target 'pie/piegen/piegen' failed
make: *** [pie/piegen/piegen] Error 2

Sounds to be some issue in the Makefile. Digging in...


> Cyrill Gorcunov (2):
>   piegen: Implement tool building
>   x86: Start using native object relocatable files in parasite code
> 
>  Makefile                |  17 ++-
>  pie/Makefile            |  33 ++++-
>  pie/pie-reloc.lds.S.in  |  27 ++++
>  pie/piegen/Makefile     |  14 ++
>  pie/piegen/elf-x86-32.c |  16 +++
>  pie/piegen/elf-x86-64.c |  16 +++
>  pie/piegen/elf.c        | 338 ++++++++++++++++++++++++++++++++++++++++++++++++
>  pie/piegen/main.c       | 127 ++++++++++++++++++
>  pie/piegen/piegen.h     |  34 +++++
>  9 files changed, 619 insertions(+), 3 deletions(-)
>  create mode 100644 pie/pie-reloc.lds.S.in
>  create mode 100644 pie/piegen/Makefile
>  create mode 100644 pie/piegen/elf-x86-32.c
>  create mode 100644 pie/piegen/elf-x86-64.c
>  create mode 100644 pie/piegen/elf.c
>  create mode 100644 pie/piegen/main.c
>  create mode 100644 pie/piegen/piegen.h
> 



More information about the CRIU mailing list