From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InD5o-0002jX-UR for qemu-devel@nongnu.org; Wed, 31 Oct 2007 08:54:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InD5o-0002jG-94 for qemu-devel@nongnu.org; Wed, 31 Oct 2007 08:54:44 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InD5n-0002j8-T6 for qemu-devel@nongnu.org; Wed, 31 Oct 2007 08:54:43 -0400 Received: from relay01.mx.bawue.net ([193.7.176.67]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1InD5m-0002yK-K6 for qemu-devel@nongnu.org; Wed, 31 Oct 2007 08:54:43 -0400 Date: Wed, 31 Oct 2007 12:54:38 +0000 From: Thiemo Seufer Subject: Re: [Qemu-devel] [PATCH] Add TPM support Message-ID: <20071031125438.GG7712@networkno.de> References: <20071031120636.GA7567@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071031120636.GA7567@thomas> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Bleher Cc: qemu-devel@nongnu.org Thomas Bleher wrote: > This patch adds support for an Atmel TPM chip. > > Background: TPMs are rather complex chips, supporting many commands and > implementing complex crypto protocols like Direct Anonymous Attestation > (DAA). Therefore, this patch does not directly implement a TPM chip, but > instead utilizes the TPM emulator project (http://tpm-emulator.berlios.de/). > The TPM emulator can be run as a daemon, communicating through a unix domain > socket. > > This patch adds a "-tpm path" parameter to qemu, where "path" is the unix > domain socket of the TPM emulator. If the parameter is given, the chip is > registered in the emulated system. Otherwise, behaviour is unchanged. > > The interface presented inside qemu is that of an Atmel TPM chip, simply > because there is a Linux driver for this chip and the interface is very > simple. I do not own any TPM chip, therefore the interface was written > purely by looking at the Linux driver. > > Use case: This patch makes it possible to experiment with software like IBMs > Integrity Measurement Architecture (IMA), without having an actual TPM (this > patch was developed for a demonstration involving IMA, among other things). > It should also be possible to use Microsofts BitLocker technology, although > this hasn't been tested yet. > > --- > Makefile.target | 3 + > hw/tpm.c | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > vl.c | 12 +++ > vl.h | 4 + > 4 files changed, 238 insertions(+), 0 deletions(-) > create mode 100644 hw/tpm.c > > diff --git a/Makefile.target b/Makefile.target > index 33dc285..3665e82 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -460,6 +460,9 @@ VL_OBJS += ne2000.o > VL_OBJS += pcnet.o > VL_OBJS += rtl8139.o > > +# TPM device > +VL_OBJS += tpm.o > + > ifeq ($(TARGET_BASE_ARCH), i386) > # Hardware support > VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) > diff --git a/hw/tpm.c b/hw/tpm.c > new file mode 100644 > index 0000000..eaebd46 > --- /dev/null > +++ b/hw/tpm.c > @@ -0,0 +1,219 @@ > +/* > + * TPM emulation > + * Written by Thomas Bleher . > + * > + * This driver emulates a TPM chip. TPM chips are quite complex, and a TPM > + * emulator already exists, therefore this driver just connects to this > + * emulator and forwards all the data. For the TPM emulator project, see > + * http://tpm-emulator.berlios.de/ > + * > + * The author does not own any TPM chip himself, so the Linux Kernel driver for > + * Atmel TPM chips was taken as a reference. The code works fine with the Linux > + * driver, but no tests have been done on other operating systems. > + * > + * Some structures are copied from the Linux Kernel source code. > + */ So the License of this file is "GPL, Version 2"? The license should be mentioned in the comment. Thiemo