From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIOtf-00067c-7C for qemu-devel@nongnu.org; Fri, 06 May 2011 13:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIOtd-0003nV-G0 for qemu-devel@nongnu.org; Fri, 06 May 2011 13:32:59 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:51960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIOtd-0003ma-Ac for qemu-devel@nongnu.org; Fri, 06 May 2011 13:32:57 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p46HJ7uf018573 for ; Fri, 6 May 2011 11:19:07 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id p46HWjLV081590 for ; Fri, 6 May 2011 11:32:47 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p46BWHQG004192 for ; Fri, 6 May 2011 05:32:18 -0600 Message-Id: <20110506173224.278066589@linux.vnet.ibm.com> Date: Fri, 06 May 2011 13:32:24 -0400 From: Stefan Berger Subject: [Qemu-devel] [PATCH V4 00/10] Qemu Trusted Platform Module (TPM) integration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stefanb@linux.vnet.ibm.com, qemu-devel@nongnu.org Cc: andreas.niederl@iaik.tugraz.at, serge@hallyn.com The following series of patches adds a TPM (Trusted Platform Module) TIS (TPM Interface Spec) interface to Qemu and with that provides means to access a backend implementing the actual TPM functionality. This frontend enables for example Linux's TPM TIS (tpm_tis) driver. I am also posting the implementation of a backend implementation that is based on a library (libtpms) providing TPM functionality. This library is currently undergoing further testing but is now available via Fedora Rawhide: http://download.fedora.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/Packages/libtpms-0.5.1-5.x86_64.rpm http://download.fedora.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/Packages/libtpms-devel-0.5.1-5.x86_64.rpm All testing was done with the libtpms-based backend. It provides support for VM suspend/resume, migration and snapshotting. It uses QCoW2 as the file format for storing its persistent state onto, which is necessary for support of snapshotting. Using Linux as the OS along with some recently posted patches for the Linux TPM TIS driver, suspend/resume works fine (using 'virsh save/restore') along with hibernation and OS suspend (ACPI S3). Proper support for the TPM requires support in the BIOS since the BIOS needs to initialize the TPM upon machine start or issue commands to the TPM when it resumes from suspend (ACPI S3). It also builds and connects the necessary ACPI tables (SSDT for TPM device, TCPA table for logging) to the ones that are built by a BIOS. To support this I have fairly extensive set of extensions for SeaBIOS that have already been posted to the SeaBIOS mailing list and been ACK'ed by Kevin (thank you! :-)). v4: - applies to checkout of d2d979c6 - more coding style fixes - adding patch for supporting blob encryption (in addition to the existing QCoW2-level encryption) - this allows for graceful termination of a migration if the target is detected to have a wrong key - tested with big and little endian hosts - main thread releases mutex while checking for work to do on behalf of backend - introducing file locking (fcntl) on the block layer for serializing access to shared (QCoW2) files (used during migration) v3: - Building a null driver at patch 5/8 that responds to all requests with an error response; subsequently this driver is transformed to the libtpms-based driver for real TPM functionality - Reworked the threading; dropped the patch for qemu_thread_join; the main thread synchronizing with the TPM thread termination may need to write data to the block storage while waiting for the thread to terminate; did not previously show a problem but is safer - A lot of testing based on recent git checkout 4b4a72e5 (4/10): - migration of i686 VM from x86_64 host to i686 host to ppc64 host while running tests inside the VM - tests with S3 suspend/resume - tests with snapshots - multiple-hour tests with VM suspend/resume (using virsh save/restore) while running a TPM test suite inside the VM All tests passed; [not all of them were done on the ppc64 host] v2: - splitting some of the patches into smaller ones for easier review - fixes in individual patches Regards, Stefan