From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751198AbdAKS1i (ORCPT ); Wed, 11 Jan 2017 13:27:38 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46052 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbdAKS1g (ORCPT ); Wed, 11 Jan 2017 13:27:36 -0500 Subject: Re: [tpmdd-devel] [PATCH RFC 0/4] RFC: in-kernel resource manager To: Jason Gunthorpe , Andreas Fuchs References: <201701041612.v04GCfPK031525@wind.enjellic.com> <20170109231635.6wh25qoy7svcnys6@intel.com> <20170110200558.GA5102@obsidianresearch.com> <20170111180328.GB22783@obsidianresearch.com> Cc: Ken Goldman , greg@enjellic.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, tpmdd-devel@lists.sourceforge.net From: Stefan Berger Date: Wed, 11 Jan 2017 13:27:30 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20170111180328.GB22783@obsidianresearch.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011118-8235-0000-0000-00000A57B674 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006415; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00806246; UDB=6.00392326; IPR=6.00583580; BA=6.00005049; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013893; XFM=3.00000011; UTC=2017-01-11 18:27:34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011118-8236-0000-0000-000038501722 Message-Id: <7a61bdf9-da82-c772-7e73-d4a4ffc25559@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-11_16:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701110248 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2017 01:03 PM, Jason Gunthorpe wrote: > On Wed, Jan 11, 2017 at 11:00:43AM +0100, Andreas Fuchs wrote: > >> could we please get an ioctl, that switches the "mode" of the fd entirely. >> I'd like to see the write()/read() support still intact. >> All my current code uses main-loop based poll on the fd and I don't want >> to be force to start using threads... > We currently do not support poll in the kernel for /dev/tpmX. > > ie we do not supply a poll method for 'struct file_operations'. > > Even worse, the current implementation blocks returning from write() > until the TPM has completed its work, so it doesn't even make sense to > combine it with poll. Newer applications could issue an ioctl() after the open() to unblock the write(). Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Berger Subject: Re: [PATCH RFC 0/4] RFC: in-kernel resource manager Date: Wed, 11 Jan 2017 13:27:30 -0500 Message-ID: <7a61bdf9-da82-c772-7e73-d4a4ffc25559@linux.vnet.ibm.com> References: <201701041612.v04GCfPK031525@wind.enjellic.com> <20170109231635.6wh25qoy7svcnys6@intel.com> <20170110200558.GA5102@obsidianresearch.com> <20170111180328.GB22783@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170111180328.GB22783-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jason Gunthorpe , Andreas Fuchs Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ken Goldman , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, greg-R92VP3DqSWVWk0Htik3J/w@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On 01/11/2017 01:03 PM, Jason Gunthorpe wrote: > On Wed, Jan 11, 2017 at 11:00:43AM +0100, Andreas Fuchs wrote: > >> could we please get an ioctl, that switches the "mode" of the fd entirely. >> I'd like to see the write()/read() support still intact. >> All my current code uses main-loop based poll on the fd and I don't want >> to be force to start using threads... > We currently do not support poll in the kernel for /dev/tpmX. > > ie we do not supply a poll method for 'struct file_operations'. > > Even worse, the current implementation blocks returning from write() > until the TPM has completed its work, so it doesn't even make sense to > combine it with poll. Newer applications could issue an ioctl() after the open() to unblock the write(). Stefan ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi