[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170102210101.GA5544@obsidianresearch.com>
Date: Mon, 2 Jan 2017 14:01:01 -0700
From: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc: tpmdd-devel@...ts.sourceforge.net,
linux-security-module@...r.kernel.org,
Peter Huewe <peterhuewe@....de>,
Marcel Selhorst <tpmdd@...horst.net>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC 1/4] tpm: migrate struct tpm_buf to struct tpm_chip
On Mon, Jan 02, 2017 at 03:22:07PM +0200, Jarkko Sakkinen wrote:
> Since there is only one thread using TPM chip at a time to transmit data
> we can migrate struct tpm_buf to struct tpm_chip. This makes the use of
> it more fail safe as the buffer is allocated from heap when the device
> is created and not for every transaction.
Eh? What? I don't think that is the case..
We don't serialize until we hit tramsit_cmd at which point the buffer
is already being used and cannot be shared between threads.
Only /dev/tpmX has any sort of locking, but even that is
designed to be optional (eg I patch it out of my kernels), and only
covers userspace, not contention with in-kernel threads.
Why would the resource manager need a single global tpm buffer? That
seems like a big regression from where we have been going. I don't
think this is a good idea to go down this road.
> - tpm_buf_append(buf, (u8 *) &value2, 4);
> + tpm_buf_append(buf, (u8 *)&value2, 4);
Please try and avoid this sort of churn in patches that change things..
Jason
Powered by blists - more mailing lists