Lines Matching +full:memory +full:- +full:region

1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
16 * NE_CREATE_VM - The command is used to create a slot that is associated with
20 * setting any resources, such as memory and vCPUs, for an
21 * enclave. Memory and vCPUs are set for the slot mapped to an enclave.
25 * Its format is the detailed in the cpu-lists section:
26 * https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html
34 * * Enclave file descriptor - Enclave file descriptor used with
35 * ioctl calls to set vCPUs and memory
37 * * -1 - There was a failure in the ioctl logic.
39 * * EFAULT - copy_to_user() failure.
40 * * ENOMEM - Memory allocation failure for internal
42 * * NE_ERR_NO_CPUS_AVAIL_IN_POOL - No NE CPU pool set / no CPUs available
50 * NE_ADD_VCPU - The command is used to set a vCPU for an enclave. The vCPU can
51 * be auto-chosen from the NE CPU pool or it can be set by the
63 * * 0 - Logic successfully completed.
64 * * -1 - There was a failure in the ioctl logic.
66 * * EFAULT - copy_from_user() / copy_to_user() failure.
67 * * ENOMEM - Memory allocation failure for internal
69 * * EIO - Current task mm is not the same as the one
71 * * NE_ERR_NO_CPUS_AVAIL_IN_POOL - No CPUs available in the NE CPU pool.
72 * * NE_ERR_VCPU_ALREADY_USED - The provided vCPU is already used.
73 * * NE_ERR_VCPU_NOT_IN_CPU_POOL - The provided vCPU is not available in the
75 * * NE_ERR_VCPU_INVALID_CPU_CORE - The core id of the provided vCPU is invalid
77 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state
79 * * NE_ERR_INVALID_VCPU - The provided vCPU is not in the available
86 * NE_GET_IMAGE_LOAD_INFO - The command is used to get information needed for
87 * in-memory enclave image loading e.g. offset in
88 * enclave memory to start placing the enclave image.
90 * It includes info provided by the caller - flags -
91 * and returns the offset in enclave memory where to
98 * * 0 - Logic successfully completed.
99 * * -1 - There was a failure in the ioctl logic.
101 * * EFAULT - copy_from_user() / copy_to_user() failure.
102 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state (init =
104 * * NE_ERR_INVALID_FLAG_VALUE - The value of the provided flag is invalid.
109 * NE_SET_USER_MEMORY_REGION - The command is used to set a memory region for an
110 * enclave, given the allocated memory from the
111 * userspace. Enclave memory needs to be from the
113 * The user memory region is an input parameter. It
114 * includes info provided by the caller - flags,
115 * memory size and userspace address.
121 * * 0 - Logic successfully completed.
122 * * -1 - There was a failure in the ioctl logic.
124 * * EFAULT - copy_from_user() failure.
125 * * EINVAL - Invalid physical memory region(s) e.g.
127 * * EIO - Current task mm is not the same as
129 * * ENOMEM - Memory allocation failure for internal
131 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state
133 * * NE_ERR_INVALID_MEM_REGION_SIZE - The memory size of the region is not
135 * * NE_ERR_INVALID_MEM_REGION_ADDR - Invalid user space address given.
136 * * NE_ERR_UNALIGNED_MEM_REGION_ADDR - Unaligned user space address given.
137 * * NE_ERR_MEM_REGION_ALREADY_USED - The memory region is already used.
138 * * NE_ERR_MEM_NOT_HUGE_PAGE - The memory region is not backed by
140 * * NE_ERR_MEM_DIFFERENT_NUMA_NODE - The memory region is not from the same
142 * * NE_ERR_MEM_MAX_REGIONS - The number of memory regions set for
144 * * NE_ERR_INVALID_PAGE_SIZE - The memory region is not backed by
146 * * NE_ERR_INVALID_FLAG_VALUE - The value of the provided flag is invalid.
153 * NE_START_ENCLAVE - The command is used to trigger enclave start after the
154 * enclave resources, such as memory and CPU, have been set.
156 * includes info provided by the caller - enclave cid and
157 * flags - and returns the cid (if input cid is 0).
159 * enclave slot is created and resources, such as memory and
164 * * 0 - Logic successfully completed.
165 * * -1 - There was a failure in the ioctl logic.
167 * * EFAULT - copy_from_user() / copy_to_user() failure.
168 * * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state
170 * * NE_ERR_NO_MEM_REGIONS_ADDED - No memory regions are set.
171 * * NE_ERR_NO_VCPUS_ADDED - No vCPUs are set.
172 * * NE_ERR_FULL_CORES_NOT_USED - Full core(s) not set for the enclave.
173 * * NE_ERR_ENCLAVE_MEM_MIN_SIZE - Enclave memory is less than minimum
174 * memory size (64 MiB).
175 * * NE_ERR_INVALID_FLAG_VALUE - The value of the provided flag is invalid.
176 * * NE_ERR_INVALID_ENCLAVE_CID - The provided enclave CID is invalid.
186 * NE_ERR_VCPU_ALREADY_USED - The provided vCPU is already used.
190 * NE_ERR_VCPU_NOT_IN_CPU_POOL - The provided vCPU is not available in the
195 * NE_ERR_VCPU_INVALID_CPU_CORE - The core id of the provided vCPU is invalid
200 * NE_ERR_INVALID_MEM_REGION_SIZE - The user space memory region size is not
205 * NE_ERR_INVALID_MEM_REGION_ADDR - The user space memory region address range
210 * NE_ERR_UNALIGNED_MEM_REGION_ADDR - The user space memory region address is
215 * NE_ERR_MEM_REGION_ALREADY_USED - The user space memory region is already used.
219 * NE_ERR_MEM_NOT_HUGE_PAGE - The user space memory region is not backed by
224 * NE_ERR_MEM_DIFFERENT_NUMA_NODE - The user space memory region is backed by
229 * NE_ERR_MEM_MAX_REGIONS - The supported max memory regions per enclaves has
234 * NE_ERR_NO_MEM_REGIONS_ADDED - The command to start an enclave is triggered
235 * and no memory regions are added.
239 * NE_ERR_NO_VCPUS_ADDED - The command to start an enclave is triggered and no
244 * NE_ERR_ENCLAVE_MEM_MIN_SIZE - The enclave memory size is lower than the
249 * NE_ERR_FULL_CORES_NOT_USED - The command to start an enclave is triggered and
254 * NE_ERR_NOT_IN_INIT_STATE - The enclave is not in init state when setting
259 * NE_ERR_INVALID_VCPU - The provided vCPU is out of range of the available CPUs.
263 * NE_ERR_NO_CPUS_AVAIL_IN_POOL - The command to create an enclave is triggered
268 * NE_ERR_INVALID_PAGE_SIZE - The user space memory region is not backed by pages
273 * NE_ERR_INVALID_FLAG_VALUE - The provided flag value is invalid.
277 * NE_ERR_INVALID_ENCLAVE_CID - The provided enclave CID is invalid, either
278 * being a well-known value or the CID of the
288 * NE_EIF_IMAGE - Enclave Image Format (EIF)
295 * struct ne_image_load_info - Info necessary for in-memory enclave image
298 * (e.g. Enclave Image Format - EIF) (in).
299 * @memory_offset: Offset in enclave memory where to start placing the
308 * DOC: User memory region flags
312 * NE_DEFAULT_MEMORY_REGION - Memory region for enclave general usage.
319 * struct ne_user_memory_region - Memory region to be set for an enclave (in).
320 * @flags: Flags to determine the usage for the memory region (in).
321 * @memory_size: The size, in bytes, of the memory region to be set for
323 * @userspace_addr: The start address of the userspace allocated memory of
324 * the memory region to set for an enclave (in).
337 * NE_ENCLAVE_PRODUCTION_MODE - Start enclave in production mode.
341 * NE_ENCLAVE_DEBUG_MODE - Start enclave in debug mode.
348 * struct ne_enclave_start_info - Setup info necessary for enclave start (in / out).