Hi,
This series includes all the uAPI changes defined in the PCuABI spec that are not already in the tree or posted on the list.
The patches are not meant to be merged right now, logically this should happen together with the corresponding implementaton. Rather, I am making these patches available for reference, as the emulation of PCuABI is progressing in projects like libshim and requires the definition of these uAPI macros.
The patches are also available in this branch:
https://git.morello-project.org/kbrodsky-arm/linux/-/commits/upcoming_uapi
Thanks, Kevin
Kevin Brodsky (3): uapi: errno.h: Introduce ERESERVATION uapi: mm: Introduce PROT_MAX() uapi: mm: Introduce PROT_CAP_INVOKE
include/uapi/asm-generic/errno.h | 2 ++ include/uapi/asm-generic/mman-common.h | 8 ++++++++ 2 files changed, 10 insertions(+)
Introduce the ERESERVATION error code as per the PCuABI specification [1].
[1] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-ca...
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- include/uapi/asm-generic/errno.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h index cf9c51ac49f9..a93140555d21 100644 --- a/include/uapi/asm-generic/errno.h +++ b/include/uapi/asm-generic/errno.h @@ -120,4 +120,6 @@
#define EHWPOISON 133 /* Memory page has hardware error */
+#define ERESERVATION 192 /* Address space reservation unexpected or missing */ + #endif
Introduce PROT_MAX() and related macros as per the PCuABI specification [1].
[1] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-ca...
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- include/uapi/asm-generic/mman-common.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index 6c1aa92a92e4..77a140615d3b 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h @@ -17,6 +17,12 @@ #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
+#define _PROT_MAX_SHIFT 16 +#define PROT_MAX(prot) ((prot) << _PROT_MAX_SHIFT) + +#define PROT_EXTRACT(prot) ((prot) & (PROT_READ | PROT_WRITE | PROT_EXEC)) +#define PROT_MAX_EXTRACT(prot) (((prot) >> _PROT_MAX_SHIFT) & (PROT_READ | PROT_WRITE | PROT_EXEC)) + /* 0x01 - 0x03 are defined in linux/mman.h */ #define MAP_TYPE 0x0f /* Mask for type of mapping */ #define MAP_FIXED 0x10 /* Interpret addr exactly */
Introduce PROT_CAP_INVOKE as per the PCuABI specification [1].
[1] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-ca...
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- include/uapi/asm-generic/mman-common.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index 77a140615d3b..cc73bd4084f9 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h @@ -17,6 +17,8 @@ #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
+#define PROT_CAP_INVOKE 0x2000 /* mmap flag: provide CInvoke capability permission */ + #define _PROT_MAX_SHIFT 16 #define PROT_MAX(prot) ((prot) << _PROT_MAX_SHIFT)
linux-morello@op-lists.linaro.org