Skip to contentSkip to conversation

vtpm Mini-Os domain: mini-os tpm device drivers

PATCH In review Matthew Fioravante 3 participants 6 messages Aug 25, 2010 – Sep 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 4/7 vtpm Mini-Os domain: mini-os tpm device drivers

This patch adds tpm frontend (tpmfront) and tpm backend (tpmback) device drivers to mini-os. While these are used by vtpm-stubdom, they could be used by any mini-os domain that needs a vtpm.

extras/mini-os/include/tpmback.h new file +52 -0
diff -r 6615dd4045c7 -r 22a23fed2920 extras/mini-os/include/tpmback.h
@@ -0,0 +1,52 @@
+#include <xen/io/tpmif.h>
+#include <xen/io/xenbus.h>
+#include <mini-os/types.h>
+#ifndef TPMBACK_H
+#define TPMBACK_H
+
+struct tpmcmd {
+   domid_t domid;		/* Domid of the frontend */
+   unsigned long handle;	/* Handle of the frontend */
+   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
+   uint8_t* req;			/* tpm command bits, allocated by driver, DON'T FREE IT */
+   unsigned int resp_len;	/* Size of the outgoing command, 
+				   you set this before passing the cmd object to tpmback_resp */
+   uint8_t* resp;		/* Buffer for response - YOU MUST ALLOCATE IT, YOU MUST ALSO FREE IT */
+};
+typedef struct tpmcmd tpmcmd_t;
+
+/* Initialize the tpm backend driver */
+void init_tpmback(void);
+/* Shutdown tpm backend driver */
+void shutdown_tpmback(void);
+
+/* Blocks until a tpm command is sent from any front end.
+ * Returns a pointer to the tpm command to handle.
+ * Do not try to free this pointer or the req buffer
+ * This function will return NULL if the tpm backend driver
+ * is shutdown or any other error occurs */
+tpmcmd_t* tpmback_req_any(void);
+
+/* Blocks until a tpm command from the frontend at domid/handle
+ * is sent. 
+ * Returns NULL if domid/handle is not connected, tpmback is
+ * shutdown or shutting down, or if there is an error
+ */
+tpmcmd_t* tpmback_req(domid_t domid, unsigned int handle);
+
+/* Send the response to the tpm command back to the frontend 
+ * This function will free the tpmcmd object, but you must free the resp
+ * buffer yourself */
+void tpmback_resp(tpmcmd_t* tpmcmd);
+
+/* Waits for the first frontend to connect and then sets domid and handle appropriately.
+ * If one or more frontends are already connected, this will set domid and handle to one 
+ * of them arbitrarily. The main use for this function is to wait until a single
+ * frontend connection has occured.
+ * returns 0 on success, non-zero on failure */
+int tpmback_wait_for_frontend_connect(domid_t *domid, unsigned long *handle);
+
+/* returns the number of frontends connected */
+int tpmback_num_frontends(void);
+
+#endif
extras/mini-os/include/tpmfront.h new file +51 -0

51 lines not on this page · raw message

extras/mini-os/tpmback.c new file +1006 -0

1,006 lines not on this page · raw message

extras/mini-os/tpmfront.c new file +470 -0

470 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

extras/mini-os/include/tpmback.h

Quoted 4 lines · Matthew Fioravante, le Wed 25 Aug 2010 11:18:53 -0400, a écrit :

diff -r 6615dd4045c7 -r 22a23fed2920 extras/mini-os/include/tpmback.h

extras/mini-os/include/tpmback.h new file +0 -0
@@ -0,0 +1,52 @@

You should probably add copyright headers in the files, else it's not even sure which licence you are providing them under.

Apart from that I'm afraid I don't have the time to review your stubdom patches, but the principle is probably ok.

Samuel

#2 lore raw

Here is a patch that adds the correct license for tpmfront.[ch] and
tpmback.[ch]. Apply it on top of the previous patch.

Quoted 8 lines · Samuel Thibault

extras/mini-os/include/tpmback.h

Quoted 4 lines · Matthew Fioravante, le Wed 25 Aug 2010 11:18:53 -0400, a écrit :

diff -r 6615dd4045c7 -r 22a23fed2920 extras/mini-os/include/tpmback.h

extras/mini-os/include/tpmback.h new file +0 -0
@@ -0,0 +1,52 @@

You should probably add copyright headers in the files, else it's not even sure which licence you are providing them under.

Quoted 4 lines

Apart from that I'm afraid I don't have the time to review your stubdom patches, but the principle is probably ok.

Samuel

extras/mini-os/include/tpmback.h +35 -0
diff -r 015a5ecf29e8 extras/mini-os/include/tpmback.h
@@ -1,3 +1,38 @@
+/* LICENSE AND DISCLAIMER
+ *
+ * Copyright © 2010 The Johns Hopkins University/Applied Physics 
+ * Laboratory
+
+ * This software was developed at The Johns Hopkins University/Applied 
+ * Physics Laboratory (“JHU/APL”) that is the author thereof under the 
+ * “work made for hire” provisions of the copyright law.  Permission is 
+ * hereby granted, free of charge, to any person obtaining a copy of this 
+ * software and associated documentation (the “Software”), to use the 
+ * Software without restriction, including without limitation the rights to 
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+ * of the Software, and to permit others to do so, subject to the following 
+ * conditions:
+
+ * 1.  This LICENSE AND DISCLAIMER, including the copyright notice, shall 
+ * be included in all copies of the Software, including copies of 
+ * substantial portions of the Software; 
+
+ * 2.  JHU/APL assumes no obligation to provide support of any kind with 
+ * regard to the Software.  This includes no obligation to provide assistance
+ * in using the Software nor to provide updated versions of the Software; and
+
+ * 3.  THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY 
+ * EXPRESS OR IMPLIED WARRANTIES WHATSOEVER.  ALL WARRANTIES INCLUDING, BUT 
+ * NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+ * PURPOSE, AND NONINFRINGEMENT ARE HEREBY DISCLAIMED.  USERS ASSUME THE 
+ * ENTIRE RISK AND LIABILITY OF USING THE SOFTWARE.  USERS ARE ADVISED TO 
+ * TEST THE SOFTWARE THOROUGHLY BEFORE RELYING ON IT.  IN NO EVENT SHALL THE 
+ * JOHNS HOPKINS UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, 
+ * WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR 
+ * CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE 
+ * SOFTWARE.
+ */
+
 #include <xen/io/tpmif.h>
 #include <xen/io/xenbus.h>
 #include <mini-os/types.h>
extras/mini-os/include/tpmfront.h +35 -0
diff -r 015a5ecf29e8 extras/mini-os/include/tpmfront.h
@@ -1,3 +1,38 @@
+/* LICENSE AND DISCLAIMER
+ *
+ * Copyright © 2010 The Johns Hopkins University/Applied Physics 
+ * Laboratory
+
+ * This software was developed at The Johns Hopkins University/Applied 
+ * Physics Laboratory (“JHU/APL”) that is the author thereof under the 
+ * “work made for hire” provisions of the copyright law.  Permission is 
+ * hereby granted, free of charge, to any person obtaining a copy of this 
+ * software and associated documentation (the “Software”), to use the 
+ * Software without restriction, including without limitation the rights to 
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+ * of the Software, and to permit others to do so, subject to the following 
+ * conditions:
+
+ * 1.  This LICENSE AND DISCLAIMER, including the copyright notice, shall 
+ * be included in all copies of the Software, including copies of 
+ * substantial portions of the Software; 
+
+ * 2.  JHU/APL assumes no obligation to provide support of any kind with 
+ * regard to the Software.  This includes no obligation to provide assistance
+ * in using the Software nor to provide updated versions of the Software; and
+
+ * 3.  THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY 
+ * EXPRESS OR IMPLIED WARRANTIES WHATSOEVER.  ALL WARRANTIES INCLUDING, BUT 
+ * NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+ * PURPOSE, AND NONINFRINGEMENT ARE HEREBY DISCLAIMED.  USERS ASSUME THE 
+ * ENTIRE RISK AND LIABILITY OF USING THE SOFTWARE.  USERS ARE ADVISED TO 
+ * TEST THE SOFTWARE THOROUGHLY BEFORE RELYING ON IT.  IN NO EVENT SHALL THE 
+ * JOHNS HOPKINS UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, 
+ * WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR 
+ * CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE 
+ * SOFTWARE.
+ */
+
 #ifndef TPMFRONT_H
 #define TPMFRONT_H
 
extras/mini-os/tpmback.c +34 -0
diff -r 015a5ecf29e8 extras/mini-os/tpmback.c
@@ -1,3 +1,37 @@
+/* LICENSE AND DISCLAIMER
+ *
+ * Copyright © 2010 The Johns Hopkins University/Applied Physics 
+ * Laboratory
+
+ * This software was developed at The Johns Hopkins University/Applied 
+ * Physics Laboratory (“JHU/APL”) that is the author thereof under the 
+ * “work made for hire” provisions of the copyright law.  Permission is 
+ * hereby granted, free of charge, to any person obtaining a copy of this 
+ * software and associated documentation (the “Software”), to use the 
+ * Software without restriction, including without limitation the rights to 
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+ * of the Software, and to permit others to do so, subject to the following 
+ * conditions:
+
+ * 1.  This LICENSE AND DISCLAIMER, including the copyright notice, shall 
+ * be included in all copies of the Software, including copies of 
+ * substantial portions of the Software; 
+
+ * 2.  JHU/APL assumes no obligation to provide support of any kind with 
+ * regard to the Software.  This includes no obligation to provide assistance
+ * in using the Software nor to provide updated versions of the Software; and
+
+ * 3.  THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY 
+ * EXPRESS OR IMPLIED WARRANTIES WHATSOEVER.  ALL WARRANTIES INCLUDING, BUT 
+ * NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+ * PURPOSE, AND NONINFRINGEMENT ARE HEREBY DISCLAIMED.  USERS ASSUME THE 
+ * ENTIRE RISK AND LIABILITY OF USING THE SOFTWARE.  USERS ARE ADVISED TO 
+ * TEST THE SOFTWARE THOROUGHLY BEFORE RELYING ON IT.  IN NO EVENT SHALL THE 
+ * JOHNS HOPKINS UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, 
+ * WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR 
+ * CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE 
+ * SOFTWARE.
+ */
 #include <mini-os/os.h>
 #include <mini-os/xenbus.h>
 #include <mini-os/events.h>
extras/mini-os/tpmfront.c +34 -0
diff -r 015a5ecf29e8 extras/mini-os/tpmfront.c
@@ -1,3 +1,37 @@
+/* LICENSE AND DISCLAIMER
+ *
+ * Copyright © 2010 The Johns Hopkins University/Applied Physics 
+ * Laboratory
+
+ * This software was developed at The Johns Hopkins University/Applied 
+ * Physics Laboratory (“JHU/APL”) that is the author thereof under the 
+ * “work made for hire” provisions of the copyright law.  Permission is 
+ * hereby granted, free of charge, to any person obtaining a copy of this 
+ * software and associated documentation (the “Software”), to use the 
+ * Software without restriction, including without limitation the rights to 
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+ * of the Software, and to permit others to do so, subject to the following 
+ * conditions:
+
+ * 1.  This LICENSE AND DISCLAIMER, including the copyright notice, shall 
+ * be included in all copies of the Software, including copies of 
+ * substantial portions of the Software; 
+
+ * 2.  JHU/APL assumes no obligation to provide support of any kind with 
+ * regard to the Software.  This includes no obligation to provide assistance
+ * in using the Software nor to provide updated versions of the Software; and
+
+ * 3.  THE SOFTWARE AND ITS DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT ANY 
+ * EXPRESS OR IMPLIED WARRANTIES WHATSOEVER.  ALL WARRANTIES INCLUDING, BUT 
+ * NOT LIMITED TO, PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+ * PURPOSE, AND NONINFRINGEMENT ARE HEREBY DISCLAIMED.  USERS ASSUME THE 
+ * ENTIRE RISK AND LIABILITY OF USING THE SOFTWARE.  USERS ARE ADVISED TO 
+ * TEST THE SOFTWARE THOROUGHLY BEFORE RELYING ON IT.  IN NO EVENT SHALL THE 
+ * JOHNS HOPKINS UNIVERSITY BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING, 
+ * WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR 
+ * CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE 
+ * SOFTWARE.
+ */
 #include <mini-os/types.h>
 #include <mini-os/os.h>
 #include <mini-os/xenbus.h>

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Matthew Fioravante writes ("Re: [Xen-devel] [PATCH 4/7] vtpm Mini-Os domain: mini-os tpm device drivers"):

Quoted 4 lines

Here is a patch that adds the correct license for tpmfront.[ch] and
tpmback.[ch]. Apply it on top of the previous patch.

These files don't seem to exist in a built checkout of xen-unstable.

Ian.

#4 lore raw

you need to apply my previous set of vtpm patches first. Patch 4 adds
the files.

Quoted 8 lines · Ian Jackson

Matthew Fioravante writes ("Re: [Xen-devel] [PATCH 4/7] vtpm Mini-Os domain: mini-os tpm device drivers"):

Quoted 4 lines

Here is a patch that adds the correct license for tpmfront.[ch] and
tpmback.[ch]. Apply it on top of the previous patch.

These files don't seem to exist in a built checkout of xen-unstable.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
In reply to Ian Jackson
Quoted 7 lines · Ian Jackson, le Tue 07 Sep 2010 19:10:38 +0100, a écrit :

Matthew Fioravante writes ("Re: [Xen-devel] [PATCH 4/7] vtpm Mini-Os domain: mini-os tpm device drivers"):

Quoted 4 lines

Here is a patch that adds the correct license for tpmfront.[ch] and
tpmback.[ch]. Apply it on top of the previous patch.

These files don't seem to exist in a built checkout of xen-unstable.

They're meant to be applied on top of his previous patch.

Samuel