Skip to contentSkip to conversation

mm: raise mmap HIGH_ADDR value for s390 arch

PATCH New Li Wang 2 participants 2 messages Nov 10, 2017

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH v2 2/2 mm: raise mmap HIGH_ADDR value for s390 arch

The kernel commit 1aea9b3f92 (s390/mm: implement 5 level pages tables) enlarge the maximum address in the tasks address space from (1UL << 53) to (-PAGE_SIZE) on s390 platform.

We have to increase the HIGH_ADDR in ltp testcases accordingly otherwise that would be failed with succeeded mmap into high region:

mmap15 1 TFAIL : mmap15.c:77: mmap into high region succeeded unexpectedly

---
 testcases/kernel/syscalls/mmap/mmap15.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/mmap/mmap15.c +4 -4
index 7e917bd..a1ed667 100644
@@ -43,10 +43,10 @@ int TST_TOTAL = 1;
 #ifdef __ia64__
 # define HIGH_ADDR (void *)(0xa000000000000000UL)
 #else
-# define HIGH_ADDR (void *)(1L << 53)
+# define HIGH_ADDR (void *)(-page_size)
 #endif
 
-static long map_sz;
+static long page_size;
 
 static void setup(void);
 static void cleanup(void);
@@ -70,7 +70,7 @@ int main(int ac, char **av)
 		fd = SAFE_OPEN(cleanup, "testfile", O_RDWR | O_CREAT, 0666);
 
 		/* Attempt to mmap into highmem addr, should get ENOMEM */
-		addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
+		addr = mmap(HIGH_ADDR, page_size, PROT_READ,
 			    MAP_SHARED | MAP_FIXED, fd, 0);
 		if (addr != MAP_FAILED) {
 			tst_resm(TFAIL, "mmap into high region "
@@ -102,7 +102,7 @@ static void setup(void)
 
 	tst_tmpdir();
 
-	map_sz = getpagesize();
+	page_size = getpagesize();
 
 	TEST_PAUSE;
 }
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 2/2 mm: raise mmap HIGH_ADDR value for s390 arch

----- Original Message -----

Quoted 10 lines

The kernel commit 1aea9b3f92 (s390/mm: implement 5 level pages tables) enlarge the maximum address in the tasks address space from (1UL << 53) to (-PAGE_SIZE) on s390 platform.

We have to increase the HIGH_ADDR in ltp testcases accordingly otherwise that would be failed with succeeded mmap into high region:

mmap15 1 TFAIL : mmap15.c:77: mmap into high region succeeded unexpectedly

Pushed. I had to fix small compilation error in munmap(), variable name changed.

Regards,
Jan