Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-21 Thread Jens Wiklander
On Mon, Apr 20, 2015 at 12:20:52PM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 08:20:44AM +0200, Jens Wiklander wrote: > > > I'm not sure I understand what you mean. This function is a building > > block for the TEE driver to supply whatever interface is needed for user > > space. For

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jens Wiklander
On Mon, Apr 20, 2015 at 11:55:15AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 03:02:03PM +0200, Jens Wiklander wrote: > > > It appeared to me this driver was copying TPM's old architecture, > > > which is very much known to be broken. > > > > The struct tee_device holds a shared memor

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jason Gunthorpe
On Mon, Apr 20, 2015 at 08:20:44AM +0200, Jens Wiklander wrote: > I'm not sure I understand what you mean. This function is a building > block for the TEE driver to supply whatever interface is needed for user > space. For a Global Platform like TEE it will typically have support for > TEEC_OpenSe

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jason Gunthorpe
On Mon, Apr 20, 2015 at 03:02:03PM +0200, Jens Wiklander wrote: > > It appeared to me this driver was copying TPM's old architecture, > > which is very much known to be broken. > > The struct tee_device holds a shared memory pool from which shared > memory objects are allocated. These shared memor

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Greg Kroah-Hartman
On Mon, Apr 20, 2015 at 09:56:48AM -0600, Jason Gunthorpe wrote: > On Mon, Apr 20, 2015 at 04:54:32PM +0200, Greg Kroah-Hartman wrote: > > On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote: > > > I still suspect the expected way to write a new mid layer is to create > > > your own str

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jason Gunthorpe
On Mon, Apr 20, 2015 at 04:54:32PM +0200, Greg Kroah-Hartman wrote: > On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote: > > I still suspect the expected way to write a new mid layer is to create > > your own struct device and not rely on misc_device, > > Yes, that is the way. You c

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Greg Kroah-Hartman
On Sun, Apr 19, 2015 at 11:08:00PM -0600, Jason Gunthorpe wrote: > I still suspect the expected way to write a new mid layer is to create > your own struct device and not rely on misc_device, Yes, that is the way. You can not use misc_device for anything other than creating the char node that you

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-20 Thread Jens Wiklander
On Sat, Apr 18, 2015 at 11:29:23AM -0600, Jason Gunthorpe wrote: > On Sat, Apr 18, 2015 at 10:01:47AM +0100, Russell King - ARM Linux wrote: > > On Fri, Apr 17, 2015 at 10:30:54AM -0600, Jason Gunthorpe wrote: > > > On Fri, Apr 17, 2015 at 09:50:56AM +0200, Jens Wiklander wrote: > > > > + tee

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-19 Thread Jason Gunthorpe
On Sat, Apr 18, 2015 at 10:57:55PM +0100, Russell King - ARM Linux wrote: > > But then we trundle down to: > > > > + ctx->teedev->desc->ops->get_version(ctx, &vers.spec_version, > > + vers.uuid); > > > > If we kref teedev so it is valid then calling a driver call back after > > (or during) it'

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-18 Thread Russell King - ARM Linux
On Sat, Apr 18, 2015 at 11:29:23AM -0600, Jason Gunthorpe wrote: > On Sat, Apr 18, 2015 at 10:01:47AM +0100, Russell King - ARM Linux wrote: > > On Fri, Apr 17, 2015 at 10:30:54AM -0600, Jason Gunthorpe wrote: > > > On Fri, Apr 17, 2015 at 09:50:56AM +0200, Jens Wiklander wrote: > > > > + tee

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-18 Thread Jason Gunthorpe
On Sat, Apr 18, 2015 at 10:01:47AM +0100, Russell King - ARM Linux wrote: > On Fri, Apr 17, 2015 at 10:30:54AM -0600, Jason Gunthorpe wrote: > > On Fri, Apr 17, 2015 at 09:50:56AM +0200, Jens Wiklander wrote: > > > + teedev = devm_kzalloc(dev, sizeof(*teedev), GFP_KERNEL); > > [..] > > > + rc = mis

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-18 Thread Russell King - ARM Linux
On Fri, Apr 17, 2015 at 10:30:54AM -0600, Jason Gunthorpe wrote: > On Fri, Apr 17, 2015 at 09:50:56AM +0200, Jens Wiklander wrote: > > + teedev = devm_kzalloc(dev, sizeof(*teedev), GFP_KERNEL); > [..] > > + rc = misc_register(&teedev->miscdev); > [..] > > +void tee_unregister(struct tee_device

Re: [tpmdd-devel] [RFC PATCH 1/2] tee: generic TEE subsystem

2015-04-17 Thread Jason Gunthorpe
On Fri, Apr 17, 2015 at 09:50:56AM +0200, Jens Wiklander wrote: > + teedev = devm_kzalloc(dev, sizeof(*teedev), GFP_KERNEL); [..] > + rc = misc_register(&teedev->miscdev); [..] > +void tee_unregister(struct tee_device *teedev) > +{ [..] > + misc_deregister(&teedev->miscdev); > +} [..] >