[PATCH v6 00/18] Add support for Nitro Enclaves

2020-08-05 Thread Andra Paraschiv
lude more context on the NE overall. * Add fix for the enclave / vcpu fd creation error cleanup path. * Add fix reported by kbuild test robot . * v1: https://lore.kernel.org/lkml/20200421184150.68011-1-andra...@amazon.com/ --- Andra Paraschiv (18): nitro_enclaves: Add ioctl interface definition

[PATCH v6 01/18] nitro_enclaves: Add ioctl interface definition

2020-08-05 Thread Andra Paraschiv
interacts with the NE driver, that exposes an ioctl interface for creating an enclave and setting up its resources. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf Reviewed-by: Stefan Hajnoczi --- Changelog v5 -> v6 * Fix typo in the description about

[PATCH v6 02/18] nitro_enclaves: Define the PCI device interface

2020-08-05 Thread Andra Paraschiv
as private data for the PCI device driver and the function for the PCI device command requests handling. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * Update documentation to ker

[PATCH v6 05/18] nitro_enclaves: Handle PCI device command requests

2020-08-05 Thread Andra Paraschiv
MSI-X interrupt vector for command reply notifications to handle this type of communication events. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * Update documentation to kernel-doc format. v4 -> v5 * Remove

[PATCH v6 04/18] nitro_enclaves: Init PCI device driver

2020-08-05 Thread Andra Paraschiv
: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * Update documentation to kernel-doc format. v4 -> v5 * Remove sanity checks for situations that shouldn't happen, only if buggy syste

[PATCH v6 06/18] nitro_enclaves: Handle out-of-band PCI device events

2020-08-05 Thread Andra Paraschiv
the out-of-band events. Notify user space enclave process that is using a polling mechanism on the enclave fd. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * Update documentation to kernel-doc format. v4 -> v5 * Remove sanity chec

[PATCH v6 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

2020-08-05 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * Update documentation to kernel-doc format. * Include in the enclave memory region data structure the user space address and size for duplicate user space memory regions checks. v4 -> v5 * Include enclave

[PATCH v6 07/18] nitro_enclaves: Init misc device providing the ioctl interface

2020-08-05 Thread Andra Paraschiv
The Nitro Enclaves driver provides an ioctl interface to the user space for enclave lifetime management e.g. enclave creation / termination and setting enclave resources such as memory and CPU. This ioctl interface is mapped to a Nitro Enclaves misc device. Signed-off-by: Andra Paraschiv

[PATCH v6 11/18] nitro_enclaves: Add logic for setting an enclave memory region

2020-08-05 Thread Andra Paraschiv
: Andra Paraschiv --- Changelog v5 -> v6 * Check for max number of pages allocated for the internal data structure for pages. * Check for invalid memory region flags. * Check for aligned physical memory regions. * Update documentation to kernel-doc format. * Check for duplicate user space mem

[PATCH v6 09/18] nitro_enclaves: Add logic for setting an enclave vCPU

2020-08-05 Thread Andra Paraschiv
same NUMA node. CPU 0 and its siblings have to remain available to the primary / parent VM. Add ioctl command logic for setting an enclave vCPU. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * Check CPUs are from the same NUMA node before going through

[PATCH v6 08/18] nitro_enclaves: Add logic for creating an enclave VM

2020-08-05 Thread Andra Paraschiv
: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * Update the code base to init the ioctl function in this patch. * Update documentation to kernel-doc format. v4 -> v5 * Release the reference to the NE PCI device on create VM error. * Close enclave fd on copy_t

[PATCH v6 12/18] nitro_enclaves: Add logic for starting an enclave

2020-08-05 Thread Andra Paraschiv
associated with the enclave. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * Check for invalid enclave start flags. * Update documentation to kernel-doc format. v4 -> v5 * Add early exit on enclave start ioctl function call error. * Move sanity che

[PATCH v6 10/18] nitro_enclaves: Add logic for getting the enclave image load info

2020-08-05 Thread Andra Paraschiv
the user space tooling copies the enclave image in the memory using the given memory offset. Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * Check for invalid enclave image load flags. v4 -> v5 * Check for the enclave not being started when invoking this ioctl call. * Remove

[PATCH v6 16/18] nitro_enclaves: Add sample for ioctl interface usage

2020-08-05 Thread Andra Paraschiv
Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * Remove "rc" mentioning when printing errno string. * Remove the ioctl to query API version. * Include usage info for NUMA-aware hugetlb configuration. * Update documentation to kernel-doc

[PATCH v6 15/18] nitro_enclaves: Add Makefile for the Nitro Enclaves driver

2020-08-05 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * No changes. v4 -> v5 * No changes. v3 -> v4 * No changes. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Makefi

[PATCH v6 18/18] MAINTAINERS: Add entry for the Nitro Enclaves driver

2020-08-05 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * No changes. v4 -> v5 * No changes. v3 -> v4 * No changes. v2 -> v3 * Update file entries to be in alphabetical order. v1 -> v2 * No changes. --- MAINTAINERS | 13 + 1 file changed, 13 insertions(+

[PATCH v6 17/18] nitro_enclaves: Add overview documentation

2020-08-05 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * No changes. v4 -> v5 * No changes. v3 -> v4 * Update doc type from .txt to .rst. * Update documentation based on the changes from v4. v2 -> v3 * No changes. v1 -> v2 * New in v2. --- Documentation/nitro_enclaves/

[PATCH v6 14/18] nitro_enclaves: Add Kconfig for the Nitro Enclaves driver

2020-08-05 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v5 -> v6 * No changes. v4 -> v5 * Add arch dependency for Arm / x86. v3 -> v4 * Add PCI and SMP dependencies. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update pat

[PATCH v6 13/18] nitro_enclaves: Add logic for terminating an enclave

2020-08-05 Thread Andra Paraschiv
release callback. Free the internal enclave info used for bookkeeping. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v5 -> v6 * Update documentation to kernel-doc format. * Use directly put_page() instead of unpin_user_pages(), to ma

[PATCH net-next v3 1/4] vm_sockets: Add flags field in the vsock address data structure

2020-12-11 Thread Andra Paraschiv
> v2 * Update the field name to "svm_flags". * Split the current patch in 2 patches. Signed-off-by: Andra Paraschiv Reviewed-by: Stefano Garzarella --- include/uapi/linux/vm_sockets.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/vm_sock

[PATCH net-next v3 3/4] af_vsock: Set VMADDR_FLAG_TO_HOST flag on the receive path

2020-12-11 Thread Andra Paraschiv
VMADDR_CID_HOST. Changelog v2 -> v3 * No changes. v1 -> v2 * Set the vsock flag on the receive path in the vsock transport assignment logic. * Use bitwise operator for the vsock flag setup. * Use the updated "VMADDR_FLAG_TO_HOST" flag naming. Signed-off-by: Andra Paraschiv Revi

[PATCH net-next v3 4/4] af_vsock: Assign the vsock transport considering the vsock address flags

2020-12-11 Thread Andra Paraschiv
ged. Changelog v2 -> v3 * Update bitwise check logic to not compare result to the flag value. v1 -> v2 * Use bitwise operator to check the vsock flag. * Use the updated "VMADDR_FLAG_TO_HOST" flag naming. * Merge the checks for the g2h transport assignment in one "if"

[PATCH net-next v3 0/4] vsock: Add flags field in the vsock address

2020-12-11 Thread Andra Paraschiv
twise operators to setup and check the vsock flag. * Set the vsock flag on the receive path in the vsock transport assignment logic. * Merge the checks for the g2h transport assignment in one "if" block. * v1: https://lore.kernel.org/lkml/20201201152505.19445-1-andra...@amazon.com/ ---

[PATCH net-next v3 2/4] vm_sockets: Add VMADDR_FLAG_TO_HOST vsock flag

2020-12-11 Thread Andra Paraschiv
lag is set in the connect and listen paths. v1 -> v2 * New patch in v2, it was split from the first patch in the series. * Remove the default value for the vsock flags field. * Update the naming for the vsock flag to "VMADDR_FLAG_TO_HOST". Signed-off-by: Andra Paraschiv --- in

[PATCH net-next v2 1/4] vm_sockets: Include flags field in the vsock address data structure

2020-12-04 Thread Andra Paraschiv
-> v2 * Update the field name to "svm_flags". * Split the current patch in 2 patches. Signed-off-by: Andra Paraschiv --- include/uapi/linux/vm_sockets.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/

[PATCH net-next v2 2/4] vm_sockets: Add VMADDR_FLAG_TO_HOST vsock flag

2020-12-04 Thread Andra Paraschiv
the first patch in the series. * Remove the default value for the vsock flags field. * Update the naming for the vsock flag to "VMADDR_FLAG_TO_HOST". Signed-off-by: Andra Paraschiv --- include/uapi/linux/vm_sockets.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a

[PATCH net-next v2 3/4] af_vsock: Set VMADDR_FLAG_TO_HOST flag on the receive path

2020-12-04 Thread Andra Paraschiv
VMADDR_CID_HOST. Changelog v1 -> v2 * Set the vsock flag on the receive path in the vsock transport assignment logic. * Use bitwise operator for the vsock flag setup. * Use the updated "VMADDR_FLAG_TO_HOST" flag naming. Signed-off-by: Andra Paraschiv --- net/vmw_vsock/af_vsock.c | 12 +++

[PATCH net-next v2 4/4] af_vsock: Assign the vsock transport considering the vsock address flags

2020-12-04 Thread Andra Paraschiv
tor to check the vsock flag. * Use the updated "VMADDR_FLAG_TO_HOST" flag naming. * Merge the checks for the g2h transport assignment in one "if" block. Signed-off-by: Andra Paraschiv --- net/vmw_vsock/af_vsock.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-)

[PATCH net-next v2 0/4] vsock: Add flags field in the vsock address

2020-12-04 Thread Andra Paraschiv
ecks for the g2h transport assignment in one "if" block. * v1: https://lore.kernel.org/lkml/20201201152505.19445-1-andra...@amazon.com/ --- Andra Paraschiv (4): vm_sockets: Include flags field in the vsock address data structure vm_sockets: Add VMADDR_FLAG_TO_HOST vsock flag af_vsock:

[PATCH net-next v1 0/3] vsock: Add flag field in the vsock address

2020-12-01 Thread Andra Paraschiv
or the latest version of the patch series: * https://github.com/andraprs/linux/tree/vsock-flag-sibling-comm-v1 --- Andra Paraschiv (3): vm_sockets: Include flag field in the vsock address data structure virtio_transport_common: Set sibling VMs flag on the receive path af_vsock: Assign the vs

[PATCH net-next v1 1/3] vm_sockets: Include flag field in the vsock address data structure

2020-12-01 Thread Andra Paraschiv
instead. This flag can be set when initializing the vsock address variable used for the connect() call. Signed-off-by: Andra Paraschiv --- include/uapi/linux/vm_sockets.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/vm_sockets.h b

[PATCH net-next v1 2/3] virtio_transport_common: Set sibling VMs flag on the receive path

2020-12-01 Thread Andra Paraschiv
use case. Set the vsock flag of the remote address to the one targeted for sibling VMs communication if the following conditions are met: * The source CID of the packet is higher than VMADDR_CID_HOST. * The destination CID of the packet is higher than VMADDR_CID_HOST. Signed-off-by: Andra Paraschiv

[PATCH net-next v1 3/3] af_vsock: Assign the vsock transport considering the vsock address flag

2020-12-01 Thread Andra Paraschiv
sibling VMs use case, all the vsock packets need to be forwarded to the host, so always assign the guest->host transport if the vsock flag is set. For the other use cases, the vsock transport assignment logic is not changed. Signed-off-by: Andra Paraschiv --- net/vmw_vsock/af_vsock.c |

[PATCH net-next v4 5/5] af_vsock: Assign the vsock transport considering the vsock address flags

2020-12-14 Thread Andra Paraschiv
he vsock flag. * Use the updated "VMADDR_FLAG_TO_HOST" flag naming. * Merge the checks for the g2h transport assignment in one "if" block. Signed-off-by: Andra Paraschiv Reviewed-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 9 +++-- 1 file changed, 7 insertions(+), 2 d

[PATCH net-next v4 1/5] vm_sockets: Add flags field in the vsock address data structure

2020-12-14 Thread Andra Paraschiv
> v3 * Add "svm_flags" as a new field, not reusing "svm_reserved1". v1 -> v2 * Update the field name to "svm_flags". * Split the current patch in 2 patches. Signed-off-by: Andra Paraschiv Reviewed-by: Stefano Garzarella --- include/uapi/linux/vm_sockets

[PATCH net-next v4 4/5] af_vsock: Set VMADDR_FLAG_TO_HOST flag on the receive path

2020-12-14 Thread Andra Paraschiv
VMADDR_CID_HOST. Changelog v3 -> v4 * No changes. v2 -> v3 * No changes. v1 -> v2 * Set the vsock flag on the receive path in the vsock transport assignment logic. * Use bitwise operator for the vsock flag setup. * Use the updated "VMADDR_FLAG_TO_HOST" flag naming. Signed-off-

[PATCH net-next v4 0/5] vsock: Add flags field in the vsock address

2020-12-14 Thread Andra Paraschiv
on the receive path in the vsock transport assignment logic. * Merge the checks for the g2h transport assignment in one "if" block. * v1: https://lore.kernel.org/lkml/20201201152505.19445-1-andra...@amazon.com/ --- Andra Paraschiv (5): vm_sockets: Add flags field in the vsock

[PATCH net-next v4 2/5] vm_sockets: Add VMADDR_FLAG_TO_HOST vsock flag

2020-12-14 Thread Andra Paraschiv
field. * Update the naming for the vsock flag to "VMADDR_FLAG_TO_HOST". Signed-off-by: Andra Paraschiv Reviewed-by: Stefano Garzarella --- include/uapi/linux/vm_sockets.h | 20 1 file changed, 20 insertions(+) diff --git a/include/uapi/linux/vm_sockets.h b/include/

[PATCH net-next v4 3/5] vsock_addr: Check for supported flag values

2020-12-14 Thread Andra Paraschiv
Check if the provided flags value from the vsock address data structure includes the supported flags in the corresponding kernel version. The first byte of the "svm_zero" field is used as "svm_flags", so add the flags check instead. Changelog v3 -> v4 * New patch in v4

[PATCH v4 00/18] Add support for Nitro Enclaves

2020-06-22 Thread Andra Paraschiv
ore context on the NE overall. * Add fix for the enclave / vcpu fd creation error cleanup path. * Add fix reported by kbuild test robot . * v1: https://lore.kernel.org/lkml/20200421184150.68011-1-andra...@amazon.com/ --- Andra Paraschiv (18): nitro_enclaves: Add ioctl interface definition nit

[PATCH v4 02/18] nitro_enclaves: Define the PCI device interface

2020-06-22 Thread Andra Paraschiv
private data for the PCI device driver and the functions for the PCI device init / uninit and command requests handling. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Remove the "packed" attribut

[PATCH v4 05/18] nitro_enclaves: Handle PCI device command requests

2020-06-22 Thread Andra Paraschiv
MSI-X interrupt vector for command reply notifications to handle this type of communication events. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv Fix issue reported in: https://lore.kernel.org/lkml/202004231644.xtmn4z1z%25...@intel.com/ Reported-by: kbuild test robot

[PATCH v4 01/18] nitro_enclaves: Add ioctl interface definition

2020-06-22 Thread Andra Paraschiv
interacts with the NE driver, that exposes an ioctl interface for creating an enclave and setting up its resources. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Decouple NE ioctl interface from KVM API. * Add NE API version and the corresponding ioctl c

[PATCH v4 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Add NUMA node field for an enclave metadata as the enclave memory and CPUs need to be from the same NUMA node. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Add encla

[PATCH v4 07/18] nitro_enclaves: Init misc device providing the ioctl interface

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves driver provides an ioctl interface to the user space for enclave lifetime management e.g. enclave creation / termination and setting enclave resources such as memory and CPU. This ioctl interface is mapped to a Nitro Enclaves misc device. Signed-off-by: Andra Paraschiv

[PATCH v4 08/18] nitro_enclaves: Add logic for enclave vm creation

2020-06-22 Thread Andra Paraschiv
: Andra Paraschiv --- Changelog v3 -> v4 * Use dev_err instead of custom NE log pattern. * Update the NE ioctl call to match the decoupling from the KVM API. * Add metadata for the NUMA node for the enclave memory and CPUs. v2 -> v3 * Remove the WARN_ON calls. * Update static calls

[PATCH v4 04/18] nitro_enclaves: Init PCI device driver

2020-06-22 Thread Andra Paraschiv
: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Use dev_err instead of custom NE log pattern. * Update NE PCI driver name to "nitro_enclaves". v2 -> v3 * Remove the GPL additional wording as SPDX-Licen

[PATCH v4 06/18] nitro_enclaves: Handle out-of-band PCI device events

2020-06-22 Thread Andra Paraschiv
the out-of-band events. Notify user space enclave process that is using a polling mechanism on the enclave fd. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Use dev_err instead of custom NE log pattern. * Return IRQ_NONE when interrupts are

[PATCH v4 09/18] nitro_enclaves: Add logic for enclave vcpu creation

2020-06-22 Thread Andra Paraschiv
cores and from the same NUMA node. CPU 0 and its siblings have to remain available to the primary / parent VM. Add ioctl command logic for enclave vCPU creation. Return as result a file descriptor that is associated with the enclave vCPU. Signed-off-by: Alexandru Vasile Signed-off-by: Andra

[PATCH v4 13/18] nitro_enclaves: Add logic for enclave termination

2020-06-22 Thread Andra Paraschiv
release callback. Free the internal enclave info used for bookkeeping. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Use dev_err instead of custom NE log pattern. v2 -> v3 * Remove the WARN_ON calls. * Update static calls sanity checks. * Update

[PATCH v4 12/18] nitro_enclaves: Add logic for enclave start

2020-06-22 Thread Andra Paraschiv
associated with the enclave. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Use dev_err instead of custom NE log pattern. * Update the naming for the ioctl command from metadata to info. * Check for minimum enclave memory size. v2 -> v3 * Remo

[PATCH v4 10/18] nitro_enclaves: Add logic for enclave image load info

2020-06-22 Thread Andra Paraschiv
the user space tooling copies the enclave image in the memory using the given memory offset. Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Use dev_err instead of custom NE log pattern. * Set enclave image load offset based on flags. * Update the naming for the ioctl command f

[PATCH v4 11/18] nitro_enclaves: Add logic for enclave memory region set

2020-06-22 Thread Andra Paraschiv
: Andra Paraschiv --- Changelog v3 -> v4 * Check enclave memory regions are from the same NUMA node as the enclave CPUs. * Use dev_err instead of custom NE log pattern. * Update the NE ioctl call to match the decoupling from the KVM API. v2 -> v3 * Remove the WARN_ON calls. * Update

[PATCH v4 18/18] MAINTAINERS: Add entry for the Nitro Enclaves driver

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * No changes. v2 -> v3 * Update file entries to be in alphabetical order. v1 -> v2 * No changes. --- MAINTAINERS | 13 + 1 file changed, 13 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7b5

[PATCH v4 16/18] nitro_enclaves: Add sample for ioctl interface usage

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Update usage details to match the updates in v4. * Update NE ioctl interface usage. v2 -> v3 * Remove the include directory to use the uapi from the kernel. * Remove the GPL additional wording a

[PATCH v4 15/18] nitro_enclaves: Add Makefile for the Nitro Enclaves driver

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * No changes. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Makefile to match the drivers/virt/nitro_enclaves directory. --- drivers/virt

[PATCH v4 14/18] nitro_enclaves: Add Kconfig for the Nitro Enclaves driver

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Add PCI and SMP dependencies. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Kconfig to match the drivers/virt/nitro_enclaves directory. * Updat

[PATCH v4 17/18] nitro_enclaves: Add overview documentation

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Update doc type from .txt to .rst. * Update documentation based on the changes from v4. v2 -> v3 * No changes. v1 -> v2 * New in v2. --- Documentation/nitro_enclaves/ne_overview.rst | 87 1 file ch

[PATCH v3 01/18] nitro_enclaves: Add ioctl interface definition

2020-05-25 Thread Andra Paraschiv
interacts with the NE driver, that exposes an ioctl interface for creating an enclave and setting up its resources. Include part of the KVM ioctls in the provided ioctl interface, with additional NE ioctl commands that e.g. triggers the enclave run. Signed-off-by: Alexandru Vasile Signed-off-by: Andra

[PATCH v3 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

2020-05-25 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Add enclave memory regions and vcpus count for enclave bookkeeping. * Update ne_state comments to reflect NE_START_ENCLAVE ioctl naming

[PATCH v3 00/18] Add support for Nitro Enclaves

2020-05-25 Thread Andra Paraschiv
p path. * Add fix reported by kbuild test robot . * v1: https://lore.kernel.org/lkml/20200421184150.68011-1-andra...@amazon.com/ --- Andra Paraschiv (18): nitro_enclaves: Add ioctl interface definition nitro_enclaves: Define the PCI device interface nitro_enclaves: Define enclave info for i

[PATCH v3 02/18] nitro_enclaves: Define the PCI device interface

2020-05-25 Thread Andra Paraschiv
private data for the PCI device driver and the functions for the PCI device init / uninit and command requests handling. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the GPL additional wording as S

[PATCH v3 04/18] nitro_enclaves: Init PCI device driver

2020-05-25 Thread Andra Paraschiv
: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. * Remove the WARN_ON calls. * Remove linux/bug include that is not needed. * Update static ca

[PATCH v3 06/18] nitro_enclaves: Handle out-of-band PCI device events

2020-05-25 Thread Andra Paraschiv
the out-of-band events. Notify user space enclave process that is using a polling mechanism on the enclave fd. The enclave fd is returned as a result of KVM_CREATE_VM ioctl call. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the WARN

[PATCH v3 05/18] nitro_enclaves: Handle PCI device command requests

2020-05-25 Thread Andra Paraschiv
MSI-X interrupt vector for command reply notifications to handle this type of communication events. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv Fix issue reported in: https://lore.kernel.org/lkml/202004231644.xtmn4z1z%25...@intel.com/ Reported-by: kbuild test robot

[PATCH v3 07/18] nitro_enclaves: Init misc device providing the ioctl interface

2020-05-25 Thread Andra Paraschiv
The Nitro Enclaves driver provides an ioctl interface to the user space for enclave lifetime management e.g. enclave creation / termination and setting enclave resources such as memory and CPU. This ioctl interface is mapped to a Nitro Enclaves misc device. Signed-off-by: Andra Paraschiv

[PATCH v3 09/18] nitro_enclaves: Add logic for enclave vcpu creation

2020-05-25 Thread Andra Paraschiv
An enclave, before being started, has its resources set. One of its resources is CPU. Add ioctl command logic for enclave vCPU creation. Return as result a file descriptor that is associated with the enclave vCPU. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v2

[PATCH v3 08/18] nitro_enclaves: Add logic for enclave vm creation

2020-05-25 Thread Andra Paraschiv
: Andra Paraschiv --- Changelog v2 -> v3 * Remove the WARN_ON calls. * Update static calls sanity checks. * Update kzfree() calls to kfree(). * Remove file ops that do nothing for now - open. v1 -> v2 * Add log pattern for NE. * Update goto labels to match their purpose. * Remove the

[PATCH v3 10/18] nitro_enclaves: Add logic for enclave image load metadata

2020-05-25 Thread Andra Paraschiv
the user space tooling copies the enclave image in the memory using the giveni memory offset. Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * No changes. v1 -> v2 * New in v2. --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 24 +++ 1 file changed, 24 inse

[PATCH v3 14/18] nitro_enclaves: Add Kconfig for the Nitro Enclaves driver

2020-05-25 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Kconfig to match the drivers/virt/nitro_enclaves directory. * Update help in Kconfig. --- drivers/virt/K

[PATCH v3 13/18] nitro_enclaves: Add logic for enclave termination

2020-05-25 Thread Andra Paraschiv
release callback. Free the internal enclave info used for bookkeeping. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the WARN_ON calls. * Update static calls sanity checks. * Update kzfree() calls to kfree(). v1 -> v2 * Add log pattern

[PATCH v3 12/18] nitro_enclaves: Add logic for enclave start

2020-05-25 Thread Andra Paraschiv
associated with the enclave. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the WARN_ON calls. * Update static calls sanity checks. v1 -> v2 * Add log pattern for NE. * Check if enclave state is init when starting an enclave. * Remove the

[PATCH v3 15/18] nitro_enclaves: Add Makefile for the Nitro Enclaves driver

2020-05-25 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Makefile to match the drivers/virt/nitro_enclaves directory. --- drivers/virt/Makefile| 2 ++ driver

[PATCH v3 11/18] nitro_enclaves: Add logic for enclave memory region set

2020-05-25 Thread Andra Paraschiv
space process that is associated with the enclave passes to the driver these memory regions. Add ioctl command logic for setting user space memory region for an enclave. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the WARN_ON calls. * Upd

[PATCH v3 16/18] nitro_enclaves: Add sample for ioctl interface usage

2020-05-25 Thread Andra Paraschiv
Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Remove the include directory to use the uapi from the kernel. * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * New in v2. --- samples/nitro_en

[PATCH v3 18/18] MAINTAINERS: Add entry for the Nitro Enclaves driver

2020-05-25 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * Update file entries to be in alphabetical order. v1 -> v2 * No changes. --- MAINTAINERS | 13 + 1 file changed, 13 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 50659d76976b..56d529256ba4 100644

[PATCH v3 17/18] nitro_enclaves: Add overview documentation

2020-05-25 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v2 -> v3 * No changes. v1 -> v2 * New in v2. --- Documentation/nitro_enclaves/ne_overview.txt | 86 1 file changed, 86 insertions(+) create mode 100644 Documentation/nitro_enclaves/ne_overview.txt diff --git a/Documen

[PATCH v2 00/18] Add support for Nitro Enclaves

2020-05-21 Thread Andra Paraschiv
enclave / vcpu fd creation error cleanup path. * Add fix reported by kbuild test robot . * v1: https://lore.kernel.org/lkml/20200421184150.68011-1-andra...@amazon.com/ --- Andra Paraschiv (18): nitro_enclaves: Add ioctl interface definition nitro_enclaves: Define the PCI device interface nitr

[PATCH v2 04/18] nitro_enclaves: Init PCI device driver

2020-05-21 Thread Andra Paraschiv
: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_pci_dev.c | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 drivers/virt/nitro_enclaves/ne_pci_dev.c diff --git a/drivers/virt

[PATCH v2 07/18] nitro_enclaves: Init misc device providing the ioctl interface

2020-05-21 Thread Andra Paraschiv
The Nitro Enclaves driver provides an ioctl interface to the user space for enclave lifetime management e.g. enclave creation / termination and setting enclave resources such as memory and CPU. This ioctl interface is mapped to a Nitro Enclaves misc device. Signed-off-by: Andra Paraschiv

[PATCH v2 01/18] nitro_enclaves: Add ioctl interface definition

2020-05-21 Thread Andra Paraschiv
interacts with the NE driver, that exposes an ioctl interface for creating an enclave and setting up its resources. Include part of the KVM ioctls in the provided ioctl interface, with additional NE ioctl commands that e.g. triggers the enclave run. Signed-off-by: Alexandru Vasile Signed-off-by: Andra

[PATCH v2 02/18] nitro_enclaves: Define the PCI device interface

2020-05-21 Thread Andra Paraschiv
private data for the PCI device driver and the functions for the PCI device init / uninit and command requests handling. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_pci_dev.h | 266

[PATCH v2 06/18] nitro_enclaves: Handle out-of-band PCI device events

2020-05-21 Thread Andra Paraschiv
the out-of-band events. Notify user space enclave process that is using a polling mechanism on the enclave fd. The enclave fd is returned as a result of KVM_CREATE_VM ioctl call. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_pci_dev.c

[PATCH v2 05/18] nitro_enclaves: Handle PCI device command requests

2020-05-21 Thread Andra Paraschiv
MSI-X interrupt vector for command reply notifications to handle this type of communication events. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Andra Paraschiv Fix issue reported in: https://lore.kernel.org/lkml/202004231644.xtmn4z1z%25...@intel.com/ Reported-by: kbuild test robot

[PATCH v2 09/18] nitro_enclaves: Add logic for enclave vcpu creation

2020-05-21 Thread Andra Paraschiv
An enclave, before being started, has its resources set. One of its resources is CPU. Add ioctl command logic for enclave vCPU creation. Return as result a file descriptor that is associated with the enclave vCPU. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- drivers/virt

[PATCH v2 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

2020-05-21 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_misc_dev.h | 121 ++ 1 file changed, 121 insertions(+) create mode 100644 drivers/virt/nitro_enclaves/ne_misc_dev.h diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.h b/drivers/virt/nitro_enclaves

[PATCH v2 08/18] nitro_enclaves: Add logic for enclave vm creation

2020-05-21 Thread Andra Paraschiv
: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 169 ++ 1 file changed, 169 insertions(+) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index e1866fac8220..1036221238f4 100644 --- a/drivers/virt

[PATCH v2 13/18] nitro_enclaves: Add logic for enclave termination

2020-05-21 Thread Andra Paraschiv
release callback. Free the internal enclave info used for bookkeeping. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 177 ++ 1 file changed, 177 insertions(+) diff --git a/drivers/virt/nitro_enclaves

[PATCH v2 14/18] nitro_enclaves: Add Kconfig for the Nitro Enclaves driver

2020-05-21 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- drivers/virt/Kconfig| 2 ++ drivers/virt/nitro_enclaves/Kconfig | 28 2 files changed, 30 insertions(+) create mode 100644 drivers/virt/nitro_enclaves/Kconfig diff --git a/drivers/virt/Kconfig b/drivers/virt

[PATCH v2 10/18] nitro_enclaves: Add logic for enclave image load metadata

2020-05-21 Thread Andra Paraschiv
the user space tooling copies the enclave image in the memory using the giveni memory offset. Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 24 +++ 1 file changed, 24 insertions(+) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b

[PATCH v2 15/18] nitro_enclaves: Add Makefile for the Nitro Enclaves driver

2020-05-21 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- drivers/virt/Makefile| 2 ++ drivers/virt/nitro_enclaves/Makefile | 23 +++ 2 files changed, 25 insertions(+) create mode 100644 drivers/virt/nitro_enclaves/Makefile diff --git a/drivers/virt/Makefile b/drivers/virt

[PATCH v2 12/18] nitro_enclaves: Add logic for enclave start

2020-05-21 Thread Andra Paraschiv
associated with the enclave. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 107 ++ 1 file changed, 107 insertions(+) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves

[PATCH v2 11/18] nitro_enclaves: Add logic for enclave memory region set

2020-05-21 Thread Andra Paraschiv
space process that is associated with the enclave passes to the driver these memory regions. Add ioctl command logic for setting user space memory region for an enclave. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 256

[PATCH v2 18/18] MAINTAINERS: Add entry for the Nitro Enclaves driver

2020-05-21 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- MAINTAINERS | 13 + 1 file changed, 13 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ecc0749810b0..69fe37999a9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11956,6 +11956,19 @@ S: Maintained T: git git://git.kernel.org/pub

[PATCH v2 17/18] nitro_enclaves: Add overview documentation

2020-05-21 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Documentation/nitro_enclaves/ne_overview.txt | 86 1 file changed, 86 insertions(+) create mode 100644 Documentation/nitro_enclaves/ne_overview.txt diff --git a/Documentation/nitro_enclaves/ne_overview.txt b/Documentation/nitro_enclaves

[PATCH v2 16/18] nitro_enclaves: Add sample for ioctl interface usage

2020-05-21 Thread Andra Paraschiv
Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- samples/nitro_enclaves/.gitignore | 2 + samples/nitro_enclaves/Makefile | 28 + .../include/linux/nitro_enclaves.h| 23 + .../include/uapi/linux/nitro_enclaves.h | 77

[PATCH v8 00/18] Add support for Nitro Enclaves

2020-09-04 Thread Andra Paraschiv
to include more context on the NE overall. * Add fix for the enclave / vcpu fd creation error cleanup path. * Add fix reported by kbuild test robot . * v1: https://lore.kernel.org/lkml/20200421184150.68011-1-andra...@amazon.com/ --- Andra Paraschiv (18): nitro_enclaves: Add ioctl interface defi

[PATCH v8 01/18] nitro_enclaves: Add ioctl interface definition

2020-09-04 Thread Andra Paraschiv
interacts with the NE driver, that exposes an ioctl interface for creating an enclave and setting up its resources. Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf Reviewed-by: Stefan Hajnoczi --- Changelog v7 -> v8 * Add NE custom error codes for u

[PATCH v8 02/18] nitro_enclaves: Define the PCI device interface

2020-09-04 Thread Andra Paraschiv
as private data for the PCI device driver and the function for the PCI device command requests handling. Signed-off-by: Alexandru-Catalin Vasile Signed-off-by: Alexandru Ciobotaru Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v7 -> v8 * No changes. v6 -&

[PATCH v8 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

2020-09-04 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv Reviewed-by: Alexander Graf --- Changelog v7 -> v8 * No changes. v6 -> v7 * Update the naming and add more comments to make more clear the logic of handling full CPU cores and dedicating them to the enclave. v5 -> v6 * Update documentation to kernel-d

  1   2   >