Skip to content

Commit 2f3571e

Browse files
mhiramatshuahkh
authored andcommitted
selftests: proc: Make va_max 1MB
Currently proc-self-map-files-002.c sets va_max (max test address of user virtual address) to 4GB, but it is too big for 32bit arch and 1UL << 32 is overflow on 32bit long. Also since this value should be enough bigger than vm.mmap_min_addr (64KB or 32KB by default), 1MB should be enough. Make va_max 1MB unconditionally. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Alexey Dobriyan <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 02bf1f8 commit 2f3571e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/testing/selftests/proc/proc-self-map-files-002.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ static void fail(const char *fmt, unsigned long a, unsigned long b)
4747
int main(void)
4848
{
4949
const int PAGE_SIZE = sysconf(_SC_PAGESIZE);
50-
const unsigned long va_max = 1UL << 32;
50+
/*
51+
* va_max must be enough bigger than vm.mmap_min_addr, which is
52+
* 64KB/32KB by default. (depends on CONFIG_LSM_MMAP_MIN_ADDR)
53+
*/
54+
const unsigned long va_max = 1UL << 20;
5155
unsigned long va;
5256
void *p;
5357
int fd;

0 commit comments

Comments
 (0)