From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKsga-0004SD-8F for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:54:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKsgV-0002hX-HG for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:54:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKsgV-0002h5-8K for qemu-devel@nongnu.org; Wed, 27 Mar 2013 11:54:43 -0400 Date: Wed, 27 Mar 2013 17:53:03 +0200 From: "Michael S. Tsirkin" Message-ID: <20130327155303.GB29523@redhat.com> References: <5150C415.9030302@linux.vnet.ibm.com> <87ehf3nnja.fsf@codemonkey.ws> <5150CDA8.3020300@linux.vnet.ibm.com> <51530DA2.2030409@linux.vnet.ibm.com> <51530E4B.2010203@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] vNVRAM / blobstore design List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kenneth Goldman Cc: Stefan Berger , Stefan Hajnoczi , Kent E Yoder , Corey Bryant , Michael Roth , qemu-devel , Joel Schopp , Anthony Liguori On Wed, Mar 27, 2013 at 11:43:53AM -0400, Kenneth Goldman wrote: > A few comments FWIW > > When I first did TPM 1.2, I stored different parts of the TPM NV data > (permanent data, owner evict keys, defined space) in different files. It got > ugly and I eventually changed to one big blob, This was far more portable, > worked better for real flash memory, etc. It also handles integrity and/or > encryption with less overhead. > > As for encoding, I didn't bother with DER, XML, etc, as the TPM was big enough > without importing complex parsers. The TPM already requires marshalling and > unmarshalling code in its native binary format for command and response > handling, so I just reused that code. I added version numbers and count values > to handle changes to the format, and a hash to detect corruption. > > -- > Ken Goldman kgoldman@us.ibm.com > 914-945-2415 (862-2415) Yea it's not hard to invent a random format each time we write something on disk. But I think ASN.1 BER will be useful to have in qemu anyway. E.g. it's a better format for migration than what we have now. Once we have it in tree re-using it seems cleaner than maintaining some per-TPM thing. -- MST