parisc: Add MAP_UNINITIALIZED define
Helge Deller
maintainerPATCH 1/1 parisc: Add MAP_UNINITIALIZED define
Define MAP_UNINITIALIZED and use same value as other architectures. Fixes build of debian foot package.
arch/parisc/include/uapi/asm/mman.h +2 -0
@@ -25,6 +25,8 @@#define MAP_STACK 0x40000/* give out an address that is best suited for process/thread stacks */ #define MAP_HUGETLB 0x80000/* create a huge page mapping */ #define MAP_FIXED_NOREPLACE 0x100000/* MAP_FIXED which doesn't unmap underlying mapping */ +#define MAP_UNINITIALIZED 0x4000000/* For anonymous mmap, memory could be +* uninitialized */ #define MS_SYNC 1/* synchronous memory sync */ #define MS_ASYNC 2/* sync memory asynchronously */
tools/arch/parisc/include/uapi/asm/mman.h +1 -2
@@ -39,6 +39,5 @@#define MADV_SOFT_OFFLINE 101/* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 -/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */ -#define MAP_UNINITIALIZED 0 +#define MAP_UNINITIALIZED 0x4000000#endif
Helge Deller
maintainerQuoted 2 lines · Helge Deller
Define
MAP_UNINITIALIZEDand use same value as other architectures. Fixes build of debian foot package.
I'm tempted to #define MAP_UNINITIALIZED to zero.
That flag was invented for embedded usage, and becaue of security reasons we probably will never deliver uninitialized pages to userspace on parisc. So, defining it as 0 should be fine, as this fixes build errors and won't have any other (negative) effect.
Thoughts?
Helge
Quoted 29 lines
Suggested-by John David Anglin <[email protected]>Signed-off-by Helge Deller <[email protected]>arch/parisc/include/uapi/asm/mman.h +2
-0@@ -25,6 +25,8 @@#define MAP_STACK 0x40000/* give out an address that is best suited for process/thread stacks */ #define MAP_HUGETLB 0x80000/* create a huge page mapping */ #define MAP_FIXED_NOREPLACE 0x100000/* MAP_FIXED which doesn't unmap underlying mapping */ +#define MAP_UNINITIALIZED 0x4000000/* For anonymous mmap, memory could be +* uninitialized */ #define MS_SYNC 1/* synchronous memory sync */ #define MS_ASYNC 2/* sync memory asynchronously */ tools/arch/parisc/include/uapi/asm/mman.h +1
-2@@ -39,6 +39,5 @@#define MADV_SOFT_OFFLINE 101/* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 -/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */ -#define MAP_UNINITIALIZED 0 +#define MAP_UNINITIALIZED 0x4000000#endif
Yes, I believe it only should be nonzero in nommu case.
Dave
Quoted 42 lines · Helge Deller
Quoted 2 lines · Helge Deller
Define
MAP_UNINITIALIZEDand use same value as other architectures. Fixes build of debian foot package.I'm tempted to #define
MAP_UNINITIALIZEDto zero.
That flag was invented for embedded usage, and becaue of security reasons we probably will never deliver uninitialized pages to userspace on parisc. So, defining it as 0 should be fine, as this fixes build errors and won't have any other (negative) effect.
Thoughts?Helge
Quoted 29 lines
Suggested-by John David Anglin <[email protected]>Signed-off-by Helge Deller <[email protected]>arch/parisc/include/uapi/asm/mman.h +2
-0@@ -25,6 +25,8 @@#define MAP_STACK 0x40000/* give out an address that is best suited for process/thread stacks */ #define MAP_HUGETLB 0x80000/* create a huge page mapping */ #define MAP_FIXED_NOREPLACE 0x100000/* MAP_FIXED which doesn't unmap underlying mapping */ +#define MAP_UNINITIALIZED 0x4000000/* For anonymous mmap, memory could be +* uninitialized */ #define MS_SYNC 1/* synchronous memory sync */ #define MS_ASYNC 2/* sync memory asynchronously */ tools/arch/parisc/include/uapi/asm/mman.h +1
-2@@ -39,6 +39,5 @@#define MADV_SOFT_OFFLINE 101/* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 -/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */ -#define MAP_UNINITIALIZED 0 +#define MAP_UNINITIALIZED 0x4000000#endif
Signature · 1 line
John David Anglin [email protected]
Helge Deller
maintainerPATCH v2] parisc: Add MAP_UNINITIALIZED define
In reply to Helge DellerWe will not allow unitialized anon mmaps, but we need this define to prevent build errors, e.g. the debian foot package.
arch/parisc/include/uapi/asm/mman.h +1 -0
@@ -25,6 +25,7 @@#define MAP_STACK 0x40000/* give out an address that is best suited for process/thread stacks */ #define MAP_HUGETLB 0x80000/* create a huge page mapping */ #define MAP_FIXED_NOREPLACE 0x100000/* MAP_FIXED which doesn't unmap underlying mapping */ +#define MAP_UNINITIALIZED 0/* uninitialized anonymous mmap */ #define MS_SYNC 1/* synchronous memory sync */ #define MS_ASYNC 2/* sync memory asynchronously */
tools/arch/parisc/include/uapi/asm/mman.h +0 -1
@@ -39,6 +39,5 @@#define MADV_SOFT_OFFLINE 101/* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 -/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */ #define MAP_UNINITIALIZED 0#endif
Re: PATCH v2] parisc: Add MAP_UNINITIALIZED define
Am 2020-10-12 08:50, schrieb Helge Deller:
Quoted 27 lines
We will not allow unitialized anon mmaps, but we need this define to prevent build errors, e.g. the debian foot package.
Suggested-by John David Anglin <[email protected]>Signed-off-by Helge Deller <[email protected]>arch/parisc/include/uapi/asm/mman.h +0
-0@@ -25,6 +25,7 @@#define MAP_STACK 0x40000/* give out an address that is best suited for process/thread stacks */
#defineMAP_HUGETLB0x80000/* create a huge page mapping */
#defineMAP_FIXED_NOREPLACE0x100000/*MAP_FIXEDwhich doesn't unmap
underlying mapping */arch/parisc/include/uapi/asm/mman.h +1
-0+#define MAP_UNINITIALIZED 0/* uninitialized anonymous mmap */ #define MS_SYNC 1/* synchronous memory sync */ #define MS_ASYNC 2/* sync memory asynchronously */ tools/arch/parisc/include/uapi/asm/mman.h +0
-0
tools/arch/parisc/include/uapi/asm/mman.h line 43
Quoted 6 lines
tools/arch/parisc/include/uapi/asm/mman.h +0
-1@@ -39,6 +39,5 @@#define MADV_SOFT_OFFLINE 101/* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 -/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */ #define MAP_UNINITIALIZED 0#endif
Shouldn't the define itself be deleted here, too?
Eike
Helge Deller
maintainerRe: PATCH v2] parisc: Add MAP_UNINITIALIZED define
Quoted 20 lines · Rolf Eike Beer
Am 2020-10-12 08:50, schrieb Helge Deller:
Quoted 19 lines
We will not allow unitialized anon mmaps, but we need this define to prevent build errors, e.g. the debian foot package.
Suggested-by John David Anglin <[email protected]>Signed-off-by Helge Deller <[email protected]>arch/parisc/include/uapi/asm/mman.h +0
-0@@ -25,6 +25,7 @@ #define MAP_STACK 0x40000 /* give out an address that is best suitedfor process/thread stacks */
#define MAP_HUGETLB 0x80000 /* create a huge page mapping */ #defineMAP_FIXED_NOREPLACE0x100000 /*MAP_FIXEDwhich doesn't unmap underlying mapping */
+#defineMAP_UNINITIALIZED0 /* uninitialized anonymous mmap */
Quoted 16 lines
Quoted 8 lines
#define MS_SYNC 1 /* synchronous memory sync */ #define MS_ASYNC 2 /* sync memory asynchronously */
tools/arch/parisc/include/uapi/asm/mman.h +0
-0tools/arch/parisc/include/uapi/asm/mman.h line 43
Quoted 6 lines
tools/arch/parisc/include/uapi/asm/mman.h +0
-1@@ -39,6 +39,5 @@ #define MADV_SOFT_OFFLINE 101 /* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 -/* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */ #define MAP_UNINITIALIZED 0 #endifShouldn't the define itself be deleted here, too?
No, because it doesn't include arch/parisc/include/uapi/asm/mman.h
Helge