On 07/10/2022 15:25, Amit Kachhap wrote:
Hi,
On 9/28/22 21:01, Kevin Brodsky wrote:
Add a new uapi header to define generic CHERI concepts with arm64-specific values.
To start with, provide a macro representing the VMem software permission, as defined in the PCuABI specification. The macro name matches CheriBSD, facilitating its use in a (somewhat) OS-agnostic way.
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com
arch/arm64/include/uapi/asm/cheri.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 arch/arm64/include/uapi/asm/cheri.h
diff --git a/arch/arm64/include/uapi/asm/cheri.h b/arch/arm64/include/uapi/asm/cheri.h new file mode 100644 index 000000000000..8f2b8f885fda --- /dev/null +++ b/arch/arm64/include/uapi/asm/cheri.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI__ASM_CHERI_H +#define _UAPI__ASM_CHERI_H
+#define CHERI_PERM_SW_VMEM (1 << 2) /* User[0] permission */
Can this be placed in uapi/linux/cheri.h ? May be it will help non arch mmap code to use it directly.
Unfortunately not. Although it should be possible to use the first SW permission bit for VMem on any CHERI architecture, this value is Morello-specific as the permission encoding is specific to each architecture.
Kevin
Thanks, Amit
+#endif /* _UAPI__ASM_CHERI_H */