Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5164816imm; Tue, 19 Jun 2018 06:12:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJEr+1Y3MmMbC6NjCQsztu1fnI95IK9oV3eXGDpuymDE3pS/F7VjJhes5S13g59SrrUU+2Z X-Received: by 2002:a63:7f4f:: with SMTP id p15-v6mr14965902pgn.312.1529413929953; Tue, 19 Jun 2018 06:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529413929; cv=none; d=google.com; s=arc-20160816; b=Lu/ehBKGX0J3HmEx+QD/qQT+ZI/gzVLz49TENh4hQV7oRv05DHccivVQpCTYV3a/L2 p+mL/vNv7D9DkNX7ma49AGS9ejXcUxh+HTeWFNRqWa9hm2fu5YQXQueC74xwBl0mZItk an0iqULTaRsx8I2d8/pU19PFGfA7Bni1nHuc1Cl/EsBhH5Q4KtFXNzPncQ4iM7H0kfaG t/HtFF5x/g6YgIkCednee5cb6ZSuSyC9Qk8IknekViESU0jzTi3gLMxjP+w0MfDPJT3q SHxhP1dKGtjTh+dD19LStOsfvDQ2CGSomSxxy2hljFVogEuET9mwCEzekKYnCTmAfBEa ZwhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=AqY0HCvL4PAq+dzIMKr49UEKFqye/No6X+ApZ9d74K4=; b=yz02A9rcaMq4sqFp+qkC3IsNc3KAKXZdCj+/FYAbQWHqOE5YcoPCxmvcMNcqFSs7Au VL4kNLHUt+gVJ6JpJ+bz7rTcVAvZOTIs8qwJ4BNk3N8Ad3VEkwaENzrLicLVwuSrdXrX Z57qcVbuPQ6Vc+R/pCXDHptbkPUYwfLqVAF6rapS0BbzqwMKeRqXTD7g4VmoHGNloGgl 1RNkUf14iJGxgb5JeUPqZE3ZzZN8f8i5IJcPDdUA9xx7CiyKOyED2O1B4ZqolBmtkvHp b1x3G2yOS3qi149ewL/cSoLFHhqjww81V5liGOGH6NiR4moVHePv35mMDcz0zXF5Zzo4 CsDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i88-v6si17391245pfa.219.2018.06.19.06.11.56; Tue, 19 Jun 2018 06:12:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937803AbeFSNKy (ORCPT + 99 others); Tue, 19 Jun 2018 09:10:54 -0400 Received: from mga14.intel.com ([192.55.52.115]:15438 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937703AbeFSNKw (ORCPT ); Tue, 19 Jun 2018 09:10:52 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2018 06:10:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,243,1526367600"; d="scan'208";a="50514883" Received: from aluisell-mobl2.ger.corp.intel.com (HELO localhost) ([10.249.254.128]) by orsmga008.jf.intel.com with ESMTP; 19 Jun 2018 06:10:47 -0700 Date: Tue, 19 Jun 2018 16:10:46 +0300 From: Jarkko Sakkinen To: Tadeusz Struk Cc: jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, philip.b.tricca@intel.com, James.Bottomley@HansenPartnership.com Subject: Re: [PATCH v3 0/2] tpm: add support for nonblocking operation Message-ID: <20180619131046.GC5609@linux.intel.com> References: <152882630662.30206.8805136953394285180.stgit@tstruk-mobl1.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152882630662.30206.8805136953394285180.stgit@tstruk-mobl1.jf.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 12, 2018 at 10:58:26AM -0700, Tadeusz Struk wrote: > The TCG SAPI specification [1] defines a set of functions, which allows > applications to use the TPM device in either blocking or non-blocking fashion. > Each command defined by the specification has a corresponding > Tss2_Sys__Prepare() and Tss2_Sys__Complete() call, which > together with Tss2_Sys_ExecuteAsync() is designed to allow asynchronous > mode of operation. Currently the TPM driver supports only blocking calls, > which doesn't allow asynchronous IO operations. > This patch changes it and adds support for nonblocking write and a new poll > function to enable applications, which want to take advantage of this feature. > The new functionality can be tested using standard TPM tools implemented > in [2], together with modified TCTI from [3]. > > [1] https://trustedcomputinggroup.org/wp-content/uploads/TSS_SAPI_Version-1.1_Revision-22_review_030918.pdf > [2] https://github.com/tpm2-software/tpm2-tools > [3] https://github.com/tstruk/tpm2-tss/tree/async For me the value is still a bit questionable. The benchmark looks a bit flakky to give much figures how this would work with real world workloads. I read James response and I also have to question why not just a worker thread in user space? TPM does only one command at a time anyways. Cannot take this in before I know that user space will (1) adapt to this and (2) gain value compared to a worker thread. /Jarkko