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

2020-05-26 Thread Paraschiv, Andra-Irina



On 26/05/2020 09:41, Greg KH wrote:

On Mon, May 25, 2020 at 11:57:26PM +0300, Paraschiv, Andra-Irina wrote:


On 22/05/2020 10:08, Greg KH wrote:

On Fri, May 22, 2020 at 09:29:44AM +0300, Andra Paraschiv wrote:

Signed-off-by: Alexandru Vasile 
Signed-off-by: Andra Paraschiv 

I know I don't take commits with no changelog text :(

Included in v3 the changelog for each patch in the series, in addition to
the one in the cover letter; where no changes, I just mentioned that. :)

But you didn't cc: me on that version :(


I just added you on the CC list, from v4 going on should be all good wrt 
this.


Thanks,
Andra




Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar 
Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in 
Romania. Registration number J22/2621/2005.


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

2020-05-26 Thread Greg KH
On Mon, May 25, 2020 at 11:57:26PM +0300, Paraschiv, Andra-Irina wrote:
> 
> 
> On 22/05/2020 10:08, Greg KH wrote:
> > On Fri, May 22, 2020 at 09:29:44AM +0300, Andra Paraschiv wrote:
> > > Signed-off-by: Alexandru Vasile 
> > > Signed-off-by: Andra Paraschiv 
> > I know I don't take commits with no changelog text :(
> 
> Included in v3 the changelog for each patch in the series, in addition to
> the one in the cover letter; where no changes, I just mentioned that. :)

But you didn't cc: me on that version :(



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

2020-05-25 Thread Paraschiv, Andra-Irina



On 22/05/2020 10:11, Greg KH wrote:

On Fri, May 22, 2020 at 09:29:44AM +0300, Andra Paraschiv wrote:

Signed-off-by: Alexandru Vasile 
Signed-off-by: Andra Paraschiv 

No changelog?


I included the changelog in v3.




---
  samples/nitro_enclaves/.gitignore |   2 +
  samples/nitro_enclaves/Makefile   |  28 +
  .../include/linux/nitro_enclaves.h|  23 +
  .../include/uapi/linux/nitro_enclaves.h   |  77 +++

Why are you not using the uapi files from the kernel itself?  How are
you going to keep these in sync?


Yeah, the uapi files should be used, I just removed the include folder 
from here.


Thank you.

Andra



Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar 
Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in 
Romania. Registration number J22/2621/2005.


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

2020-05-25 Thread Paraschiv, Andra-Irina



On 22/05/2020 10:08, Greg KH wrote:

On Fri, May 22, 2020 at 09:29:44AM +0300, Andra Paraschiv wrote:

Signed-off-by: Alexandru Vasile 
Signed-off-by: Andra Paraschiv 

I know I don't take commits with no changelog text :(


Included in v3 the changelog for each patch in the series, in addition 
to the one in the cover letter; where no changes, I just mentioned that. :)


Thank you.

Andra



Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar 
Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in 
Romania. Registration number J22/2621/2005.


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

2020-05-22 Thread Greg KH
On Fri, May 22, 2020 at 09:29:44AM +0300, Andra Paraschiv wrote:
> Signed-off-by: Alexandru Vasile 
> Signed-off-by: Andra Paraschiv 

No changelog?

> ---
>  samples/nitro_enclaves/.gitignore |   2 +
>  samples/nitro_enclaves/Makefile   |  28 +
>  .../include/linux/nitro_enclaves.h|  23 +
>  .../include/uapi/linux/nitro_enclaves.h   |  77 +++

Why are you not using the uapi files from the kernel itself?  How are
you going to keep these in sync?

thanks,

greg k-h


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

2020-05-22 Thread Greg KH
On Fri, May 22, 2020 at 09:29:44AM +0300, Andra Paraschiv wrote:
> Signed-off-by: Alexandru Vasile 
> Signed-off-by: Andra Paraschiv 

I know I don't take commits with no changelog text :(



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

2020-05-22 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 +++
 samples/nitro_enclaves/ne_ioctl_sample.c  | 502 ++
 5 files changed, 632 insertions(+)
 create mode 100644 samples/nitro_enclaves/.gitignore
 create mode 100644 samples/nitro_enclaves/Makefile
 create mode 100644 samples/nitro_enclaves/include/linux/nitro_enclaves.h
 create mode 100644 samples/nitro_enclaves/include/uapi/linux/nitro_enclaves.h
 create mode 100644 samples/nitro_enclaves/ne_ioctl_sample.c

diff --git a/samples/nitro_enclaves/.gitignore 
b/samples/nitro_enclaves/.gitignore
new file mode 100644
index ..827934129c90
--- /dev/null
+++ b/samples/nitro_enclaves/.gitignore
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+ne_ioctl_sample
diff --git a/samples/nitro_enclaves/Makefile b/samples/nitro_enclaves/Makefile
new file mode 100644
index ..2acdc6e0c492
--- /dev/null
+++ b/samples/nitro_enclaves/Makefile
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see .
+
+# Enclave lifetime management support for Nitro Enclaves (NE) - ioctl sample
+# usage.
+
+.PHONY: all clean
+
+CFLAGS += -Wall -Iinclude/
+
+all:
+   $(CC) $(CFLAGS) -o ne_ioctl_sample ne_ioctl_sample.c -lpthread
+
+clean:
+   rm -f ne_ioctl_sample
diff --git a/samples/nitro_enclaves/include/linux/nitro_enclaves.h 
b/samples/nitro_enclaves/include/linux/nitro_enclaves.h
new file mode 100644
index ..7e593a9fbf8c
--- /dev/null
+++ b/samples/nitro_enclaves/include/linux/nitro_enclaves.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ */
+
+#ifndef _LINUX_NITRO_ENCLAVES_H_
+#define _LINUX_NITRO_ENCLAVES_H_
+
+#include 
+
+#endif /* _LINUX_NITRO_ENCLAVES_H_ */
diff --git a/samples/nitro_enclaves/include/uapi/linux/nitro_enclaves.h 
b/samples/nitro_enclaves/include/uapi/linux/nitro_enclaves.h
new file mode 100644
index ..98ba59f15b52
--- /dev/null
+++ b/samples/nitro_enclaves/include/uapi/linux/nitro_enclaves.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ */
+
+#ifndef _UAPI_LINUX_NITRO_ENCLAVES_H_
+#define _UAPI_LINUX_NITRO_ENCLAVES_H_
+
+#include 
+#include 
+
+/* Nitro Enclaves (NE) Kernel Driver Interface */
+
+/**
+ * The command is used to get information needed for in-memory enclave image
+ * loading e.g. offset in enclave memory to start placing the enclave image.
+ *
+ * The image load metadata is an in / out data structure. It includes info
+ * provided by the caller - flags - and returns the offset in enclave memory
+ * where to start placing the enclave image.
+ */
+#define NE_GET_IMAGE_LOAD_METADATA _IOWR(0xAE, 0x20, struct 
image_load_metadata)
+
+/**
+ * The command is used to trigger enclave start