[LTP] [PATCH v3] syscalls/mmap17.c: Add new regression test

xuyang xuyang2018.jy@cn.fujitsu.com
Tue Apr 16 12:42:25 CEST 2019


on 3:59, Cyril Hrubis wrote:

> I wonder if we can address Jan's comment and make it more generic by
> trying to mmap a certain sequence of offsets in /dev/mem and either
> expect them to return a valid pointer or fail with MAP_FAILED. We would
> have to make sure that we got the 1ULL<<phys_addr_bits there for the x86
> case but we wouldn't have to skip the test on non-x86 hardware.
Hi Cyril

   This patch has been created long time ago, we should start it again. I think we
   should make this case more generic.  It should test mmap whether check physical
   addr size valid instead of triggering a rare crash.

   We can look for a max phys_addr_bit on all arch architectures.  AFAIK, the max
   phys_addr_bit is 52, we can test it as below:

   mmap(NULL, 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 1ULL<<52)





More information about the ltp mailing list