Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools headers UAPI: Update tools's copy of mman.h headers

To pick up the changes from:

8aa3c927ec10 ("mm/mmap: move common defines to mman-common.h")
22fcea6f85f2 ("mm: move MAP_SYNC to asm-generic/mman-common.h")
0bf5f9492389 ("mm: fix the MAP_UNINITIALIZED flag")

To address the following perf build warnings:

Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h'
diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman.h' differs from latest version at 'include/uapi/asm-generic/mman.h'
diff -u tools/include/uapi/asm-generic/mman.h include/uapi/asm-generic/mman.h

That ends up just moving a bit the auto-generated code->string tables:

$ tools/perf/trace/beauty/mmap_flags.sh > before
$ cp include/uapi/asm-generic/mman.h tools/include/uapi/asm-generic/mman.h
$ cp include/uapi/asm-generic/mman-common.h tools/include/uapi/asm-generic/mman-common.h
$ tools/perf/trace/beauty/mmap_flags.sh > after
$ diff -u before after
--- before 2019-07-26 12:45:02.948335904 -0300
+++ after 2019-07-26 12:48:05.342893539 -0300
@@ -4,15 +4,15 @@
[ilog2(0x02) + 1] = "PRIVATE",
[ilog2(0x10) + 1] = "FIXED",
[ilog2(0x20) + 1] = "ANONYMOUS",
+ [ilog2(0x008000) + 1] = "POPULATE",
+ [ilog2(0x010000) + 1] = "NONBLOCK",
+ [ilog2(0x020000) + 1] = "STACK",
+ [ilog2(0x040000) + 1] = "HUGETLB",
+ [ilog2(0x080000) + 1] = "SYNC",
[ilog2(0x100000) + 1] = "FIXED_NOREPLACE",
[ilog2(0x0100) + 1] = "GROWSDOWN",
[ilog2(0x0800) + 1] = "DENYWRITE",
[ilog2(0x1000) + 1] = "EXECUTABLE",
[ilog2(0x2000) + 1] = "LOCKED",
[ilog2(0x4000) + 1] = "NORESERVE",
- [ilog2(0x8000) + 1] = "POPULATE",
- [ilog2(0x10000) + 1] = "NONBLOCK",
- [ilog2(0x20000) + 1] = "STACK",
- [ilog2(0x40000) + 1] = "HUGETLB",
- [ilog2(0x80000) + 1] = "SYNC",
};
$

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-fzqvzni9megaurmsp0k4vy27@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+13 -20
-4
tools/arch/powerpc/include/uapi/asm/mman.h
··· 4 4 #define MAP_DENYWRITE 0x0800 5 5 #define MAP_EXECUTABLE 0x1000 6 6 #define MAP_GROWSDOWN 0x0100 7 - #define MAP_HUGETLB 0x40000 8 7 #define MAP_LOCKED 0x80 9 - #define MAP_NONBLOCK 0x10000 10 8 #define MAP_NORESERVE 0x40 11 - #define MAP_POPULATE 0x8000 12 - #define MAP_STACK 0x20000 13 9 #include <uapi/asm-generic/mman-common.h> 14 10 /* MAP_32BIT is undefined on powerpc, fix it for perf */ 15 11 #define MAP_32BIT 0
-4
tools/arch/sparc/include/uapi/asm/mman.h
··· 4 4 #define MAP_DENYWRITE 0x0800 5 5 #define MAP_EXECUTABLE 0x1000 6 6 #define MAP_GROWSDOWN 0x0200 7 - #define MAP_HUGETLB 0x40000 8 7 #define MAP_LOCKED 0x100 9 - #define MAP_NONBLOCK 0x10000 10 8 #define MAP_NORESERVE 0x40 11 - #define MAP_POPULATE 0x8000 12 - #define MAP_STACK 0x20000 13 9 #include <uapi/asm-generic/mman-common.h> 14 10 /* MAP_32BIT is undefined on sparc, fix it for perf */ 15 11 #define MAP_32BIT 0
+9 -6
tools/include/uapi/asm-generic/mman-common.h
··· 19 19 #define MAP_TYPE 0x0f /* Mask for type of mapping */ 20 20 #define MAP_FIXED 0x10 /* Interpret addr exactly */ 21 21 #define MAP_ANONYMOUS 0x20 /* don't use a file */ 22 - #ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED 23 - # define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be uninitialized */ 24 - #else 25 - # define MAP_UNINITIALIZED 0x0 /* Don't support this flag */ 26 - #endif 27 22 28 - /* 0x0100 - 0x80000 flags are defined in asm-generic/mman.h */ 23 + /* 0x0100 - 0x4000 flags are defined in asm-generic/mman.h */ 24 + #define MAP_POPULATE 0x008000 /* populate (prefault) pagetables */ 25 + #define MAP_NONBLOCK 0x010000 /* do not block on IO */ 26 + #define MAP_STACK 0x020000 /* give out an address that is best suited for process/thread stacks */ 27 + #define MAP_HUGETLB 0x040000 /* create a huge page mapping */ 28 + #define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */ 29 29 #define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */ 30 + 31 + #define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be 32 + * uninitialized */ 30 33 31 34 /* 32 35 * Flags for mlock
+4 -6
tools/include/uapi/asm-generic/mman.h
··· 9 9 #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ 10 10 #define MAP_LOCKED 0x2000 /* pages are locked */ 11 11 #define MAP_NORESERVE 0x4000 /* don't check for reservations */ 12 - #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ 13 - #define MAP_NONBLOCK 0x10000 /* do not block on IO */ 14 - #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ 15 - #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ 16 - #define MAP_SYNC 0x80000 /* perform synchronous page faults for the mapping */ 17 12 18 - /* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */ 13 + /* 14 + * Bits [26:31] are reserved, see asm-generic/hugetlb_encode.h 15 + * for MAP_HUGETLB usage 16 + */ 19 17 20 18 #define MCL_CURRENT 1 /* lock all current mappings */ 21 19 #define MCL_FUTURE 2 /* lock all future mappings */