[CRIU] [PATCH] arch/ppc64: Add PowerPC 64 LE support

Laurent Dufour ldufour at linux.vnet.ibm.com
Mon May 4 09:03:26 PDT 2015


On 30/04/2015 19:20, Christopher Covington wrote:
> Hi Laurent,
> 
> Great work.

Thanks a lot Christopher.

> 
> On 04/29/2015 11:47 AM, Laurent Dufour wrote:
> 
>> --- /dev/null
>> +++ b/arch/ppc64/include/asm/page.h
>> @@ -0,0 +1,23 @@
>> +#ifndef __CR_ASM_PAGE_H__
>> +#define __CR_ASM_PAGE_H__
>> +
>> +/*
>> + * Default config for Pseries is to use 64K pages.
>> + * See kernel file arch/powerpc/configs/pseries_*defconfig
>> + */
>> +#ifndef PAGE_SHIFT
>> +# define PAGE_SHIFT	16
>> +#endif
>> +
>> +#ifndef PAGE_SIZE
>> +# define PAGE_SIZE	(1UL << PAGE_SHIFT)
>> +#endif
>> +
>> +#ifndef PAGE_MASK
>> +# define PAGE_MASK	(~(PAGE_SIZE - 1))
>> +#endif
>> +
>> +#define PAGE_PFN(addr)	((addr) / PAGE_SIZE)
>> +#define page_size()	PAGE_SIZE
> 
> If pages other than 64K are possible, I'd recommend using
> sysconf(_SC_PAGESIZE) here.

PowerPC architecture support multiple page size, the default, is usually
64k, but you're right it is often better to not hard code that.
I'll get back with a patch for that soon.

>> +/*
>> + * Copied for the Linux kernel arch/powerpc/include/asm/processor.h
>> + *
>> + * NOTE: 32bit task are supported.
>> + */
>> +#define TASK_SIZE_USER64 (0x0000400000000000UL)
>> +#define TASK_SIZE TASK_SIZE_USER64
> 
> Are you able to dump 32 bit tasks with a 64 bit CRIU and this single
> hard-coded TASK_SIZE?

Nice catch, the comment should rather say "32bit tasks are *not* supported".

FYI, on ppc64le, the 32 bits task not supported while on ppc64 (Big
Endian), it depends on the kernel config. Currently major distro are
turning off the 32 bit support, so I don't think I will try to deal with
that.

> 
>> --- a/include/image.h
>> +++ b/include/image.h
>> @@ -11,7 +11,11 @@
>>  #include "bfd.h"
>>  #include "bug.h"
>>  
>> +#ifdef _ARCH_PPC64
>> +#define PAGE_IMAGE_SIZE	65536
>> +#else
>>  #define PAGE_IMAGE_SIZE	4096
>> +#endif /* _ARCH_PPC64 */
>>  #define PAGE_RSS	1
>>  #define PAGE_ANON	2
> 
> Can we just get rid of this and the check in crtools.c?

IMHO, we may, but I'm be wrong.

Cheers,
Laurent.



More information about the CRIU mailing list