[CRIU] [PATCH 4/8] x86: Add 32bit variant of TASK_SIZE

Pavel Emelyanov xemul at parallels.com
Fri May 15 05:28:13 PDT 2015


On 05/15/2015 03:01 PM, Cyrill Gorcunov wrote:
> On Fri, May 15, 2015 at 02:36:13PM +0300, Pavel Emelyanov wrote:
>>>
>>> There are two limits for user space, depending on kernel
>>> configuration: 0xc0000000 or 0xffffe000. 
>>
>> O_o  Really??? Which config option controls this? I remember
>> the so called 4g-split patches, which extended the userspace
>> memory up to amost 4G, but AFAIK they never found their way
>> into the mainstream kernel.
> 
> ARCH="i386" make nconfig
> 
> Processor type and features -->
>   Memory split (3G/1G user/kernel split) -->
> 
> which modifies CONFIG_PAGE_OFFSET --> __PAGE_OFFSET -> PAGE_OFFSET -> TASK_SIZE

For i386

        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0x80000000 if VMSPLIT_2G
        default 0x78000000 if VMSPLIT_2G_OPT
        default 0x40000000 if VMSPLIT_1G
        default 0xC0000000

the 0xffffe000 is only available for 32-bit tasks on x64 without
ADDR_LIMIT_3GB in personality

#define IA32_PAGE_OFFSET        ((current->personality & ADDR_LIMIT_3GB) ? \
                                        0xc0000000 : 0xFFFFe000)

#define TASK_SIZE               (test_thread_flag(TIF_ADDR32) ? \
                                        IA32_PAGE_OFFSET : TASK_SIZE_MAX)

> I guess even current 0xffffe000 might be not enough depending on
> kernel config. It simply fit for my testing (ia32e mode) but
> may be updated later.
> .
> 



More information about the CRIU mailing list