blob: 5256cf3a950a3d02032a03a3ccd128bf4e53e3e7 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris32ff3f82020-12-14 13:10:04 -08007#ifndef _UAPI_LINUX_NITRO_ENCLAVES_H_
8#define _UAPI_LINUX_NITRO_ENCLAVES_H_
9#include <linux/types.h>
10#define NE_CREATE_VM _IOR(0xAE, 0x20, __u64)
11#define NE_ADD_VCPU _IOWR(0xAE, 0x21, __u32)
12#define NE_GET_IMAGE_LOAD_INFO _IOWR(0xAE, 0x22, struct ne_image_load_info)
13#define NE_SET_USER_MEMORY_REGION _IOW(0xAE, 0x23, struct ne_user_memory_region)
14#define NE_START_ENCLAVE _IOWR(0xAE, 0x24, struct ne_enclave_start_info)
15#define NE_ERR_VCPU_ALREADY_USED (256)
16#define NE_ERR_VCPU_NOT_IN_CPU_POOL (257)
17#define NE_ERR_VCPU_INVALID_CPU_CORE (258)
18#define NE_ERR_INVALID_MEM_REGION_SIZE (259)
19#define NE_ERR_INVALID_MEM_REGION_ADDR (260)
20#define NE_ERR_UNALIGNED_MEM_REGION_ADDR (261)
21#define NE_ERR_MEM_REGION_ALREADY_USED (262)
22#define NE_ERR_MEM_NOT_HUGE_PAGE (263)
23#define NE_ERR_MEM_DIFFERENT_NUMA_NODE (264)
24#define NE_ERR_MEM_MAX_REGIONS (265)
25#define NE_ERR_NO_MEM_REGIONS_ADDED (266)
26#define NE_ERR_NO_VCPUS_ADDED (267)
27#define NE_ERR_ENCLAVE_MEM_MIN_SIZE (268)
28#define NE_ERR_FULL_CORES_NOT_USED (269)
29#define NE_ERR_NOT_IN_INIT_STATE (270)
30#define NE_ERR_INVALID_VCPU (271)
31#define NE_ERR_NO_CPUS_AVAIL_IN_POOL (272)
32#define NE_ERR_INVALID_PAGE_SIZE (273)
33#define NE_ERR_INVALID_FLAG_VALUE (274)
34#define NE_ERR_INVALID_ENCLAVE_CID (275)
35#define NE_EIF_IMAGE (0x01)
36#define NE_IMAGE_LOAD_MAX_FLAG_VAL (0x02)
37struct ne_image_load_info {
38 __u64 flags;
39 __u64 memory_offset;
40};
41#define NE_DEFAULT_MEMORY_REGION (0x00)
42#define NE_MEMORY_REGION_MAX_FLAG_VAL (0x01)
43struct ne_user_memory_region {
44 __u64 flags;
45 __u64 memory_size;
46 __u64 userspace_addr;
47};
48#define NE_ENCLAVE_PRODUCTION_MODE (0x00)
49#define NE_ENCLAVE_DEBUG_MODE (0x01)
50#define NE_ENCLAVE_START_MAX_FLAG_VAL (0x02)
51struct ne_enclave_start_info {
52 __u64 flags;
53 __u64 enclave_cid;
54};
55#endif